我在桌面的Python 3.4安装中运行从网络获取的文件,并收到语法错误,例如:
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'
跳过一些不必要的defs,有:
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 vs 3.4的差异?我不确定源文件的创建版本。来源来自IBridgePy github repo