Reputation: 1
I'm new to python and programming, I have a task to run the following file: http://pastebin.com/UmheVyvV with Python, but I get error on line 163:
line 163
print filename + " "*(80 - len(filename) - len(ln)) + ln + delim,
SyntaxError: invalid syntax
There's a '^' below filename in the error message.
Could anyone tell me how to solve this problem and be able to run the file? Thanks!
Upvotes: 0
Views: 293
Reputation: 1151
The '^' shows you where the syntax is incorrect. Depending on python version parenthesis should be used.
doc http://docs.python.org/2/tutorial/errors.html
Upvotes: 0
Reputation: 292
If you are using python 3. the print statement become a function so you need to put parentheses. example:
print (1+3)
Upvotes: 1
Reputation: 368954
Replace <
with (
:
print filename + " "*(80 - len(filename) - len(ln)) + ln + delim,
# ^
UPDATE
The code in the given url is written for Python 2.x. It will not work in Python 3.x.
Upvotes: 1