I'm trying to run scripts using python on a mac osx 10.9.2, and I'm not getting this invalid character problem I'm having.
I have a script with just this line: print “why does this not work? what non-ascii char?”;
If I run it using python (2.7.5), it gives this error:
File "script.2.py", line 1
SyntaxError: Non-ASCII character '\xe2' in file script.2.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
If I change the script to:
print(“what invalid char in identifier!?”);
and run it with python 3.4.0, I get:
File "script.3.py", line 1
print(“what invalid char in identifier!?”);
^
SyntaxError: invalid character in identifier
Can someone please help? How do I specify char coding? Thanks.
"quotes. Are you writing this is TextEdit? - mhlester