0

I don't have much knowledge of python. I have a code written in python which I am trying to compile. Its giving me following error

 File "parseBvh.py", line 382
    print(T[0],T[1],T[2],file=fp)
                             ^
SyntaxError: invalid syntax

I tried to find out the correct syntax but am not able to. Can someone point me in right direction?

poke
  • 369,085
  • 72
  • 557
  • 602
user3234277
  • 63
  • 1
  • 5

1 Answers1

1

In Python 2, print is a statement, not a function:

print >> fp, T[0],T[1],T[2]

or (probably better):

fp.write(" ".join(T[:3]) + "\n") # [:3] may be dropped if T only has 3 items
Tim Pietzcker
  • 328,213
  • 58
  • 503
  • 561