我寫了下面的腳本,其生成SyntaxError
:語法錯誤
#!/usr/bin/python
print "Enter the filename: "
filename = raw_input("> ")
print "Here is your file %r: ", % filename
txt = open(filename)
print txt.read()
txt.close()
以下是錯誤:
File "ex02.py", line 4
print "Here is your file %r: ", % filename
^
SyntaxError: invalid syntax
我應該如何解決這個問題?
感謝大家。這是一個愚蠢的錯誤。剛開始用python :) – John 2012-04-09 05:53:22