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!
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.
If you are using python 3. the print statement become a function so you need to put parentheses. example:
print (1+3)
The '^' shows you where the syntax is incorrect. Depending on python version parenthesis should be used.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.