擅长:python、mysql、java
<p>你说是<code>if int(splitLine[0]) > int(lastUnix):</code>引起了麻烦,但实际上你没有表现出任何暗示。
我认为这一行是问题所在:</p>
<pre><code>print 'Pulled', + stock
</code></pre>
<p>你明白为什么这一行会导致错误信息吗?你也要</p>
<pre><code>>>> stock = "AAAA"
>>> print 'Pulled', stock
Pulled AAAA
</code></pre>
<p>或者</p>
<pre><code>>>> print 'Pulled ' + stock
Pulled AAAA
</code></pre>
<p>不是</p>
<pre><code>>>> print 'Pulled', + stock
PulledTraceback (most recent call last):
File "<ipython-input-5-7c26bb268609>", line 1, in <module>
print 'Pulled', + stock
TypeError: bad operand type for unary +: 'str'
</code></pre>
<p>你要求Python将<code>+</code>符号应用于一个字符串,比如<code>+23</code>使23为正,而她反对。</p>