-3

I'm running files obtained from the web in my desktop's Python 3.4 install, and getting syntax errors, such as:

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'

skipping a few defs which aren't pre-requisite, there's:

 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'

for which the interpreter responds

print self.symbol, status, 'filled=',filled, 'remaining=', remaining
         ^
SyntaxError: invalid syntax

Is this perhaps due to a difference of 2.7 vs 3.4? I'm not sure what version the source file was created in. Source is from IBridgePy github repo

Prune
  • 76,765
  • 14
  • 60
  • 81
CB001
  • 21
  • 1
  • 1
  • 4

1 Answers1

0

Check the Python 3 docs.

Python 3 uses () around the print contents - print ('python')

Tim
  • 2,563
  • 1
  • 23
  • 31