【发布时间】:2016-03-28 05:12:59
【问题描述】:
我正在使用 python 包 boto 将 python 连接到 MTurk。我需要奖励价格类型的奖金。我想测试一个 Price 对象是否等于某个值。具体来说,当我想奖励奖金时,我需要检查他们的奖金不为 0(因为当您尝试在 MTurk 中奖励奖金时,它必须是正数)。但是当我去检查值时,我不能这样做。例如,
from boto.mturk.connection import MTurkConnection
from boto.mturk.price import Price
a = Price(0)
a == 0
a == Price(0)
a == Price(0.0)
a > Price(0)
a < Price(0)
c = Price(.05)
c < Price(0)
c < Price(0.0)
这些会产生意想不到的答案。
我不确定如何测试 a 的价格是否等于 0。有什么建议吗?
【问题讨论】:
-
想通了 - 需要做
a.amount。
标签: python boto mechanicalturk