我在桌面的Python3.4安装中运行从web获取的文件,并出现语法错误,例如:
class MyClient(IBCpp.IBClient):
def setup(self):
self.stime=None
self.nextId=0
# self.symbol='STK.AAPL'
# self.symbol='CASH.EUR.USD'
self.symbol='FUT.ES.USD.201506'
self.state='first'
跳过一些不是先决条件的def,有:
def orderStatus(self,orderId, status, filled, remaining, avgFillPrice,
permId, parentId, lastFillPrice, clientId, whyHeld):
"""
call back function of IB C++ API which update status or certain order
indicated by orderId
"""
print self.symbol, status, 'filled=',filled, 'remaining=', remaining'
口译员对此作出回应
print self.symbol, status, 'filled=',filled, 'remaining=', remaining
^
SyntaxError: invalid syntax
这可能是因为2.7和3.4的差异吗?我不确定创建源文件的版本。源来自IBridgePy github repo
Check the Python 3 docs.
python3使用
()
围绕打印内容-print ('python')
相关问题 更多 >
编程相关推荐