Newbie -- trying to learn python on mac. Installed v2 and v3. -- tried to run the following script from terminal:
No problem running it from the interpreter
Thanks in advance
#!/usr/bin/python # -*- coding: latin-1 -*- import os, sys f = open(‘CROSSWD.TXT’, 'r+') for line in f: word=line.strip() if len(word)>20: print wordthis is the error message I get:
Error: File "ppp.py", line 5
f = open(?CROSSWD.TXT?, 'r+')
^
SyntaxError: invalid syntax
(the symbol ^ appears under the first question mark -- this post has altered the position)No problem running it from the interpreter
Thanks in advance