0

Sorry I am not familar with Python...

It gives me the following error message

  File "gen_compile_files_list.py", line 36
    print 'java files:', n_src
                      ^
SyntaxError: invalid syntax

I.e. caret points to last quote. What's wrong with it?

OS Windows 7, Python version 3.2.2

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385

3 Answers3

4

On Python 3, print is a function. You need this:

print('java files:', n_src)
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
2

print changed syntax between Python2 and Python3; it is now a function.

You would need to change:

 print 'java files:', n_src

to

 print('java files:', n_src)

Alternatively, you can try converting the code from Python2 to Python3 syntax with the 2to3 tool. Here is more information on the transition if you are interested. This way you can maintain a single code base that works on both versions.

As you are not familiar with python, try installing Python 2 instead and running the code with that.

j13r
  • 2,576
  • 2
  • 21
  • 28
1

print is a function in Python 3+. So:

print ('java files:', n_src)
Andrew Jaffe
  • 26,554
  • 4
  • 50
  • 59