running 2.7.5
on Mac
from the command prompt --
>>> Print "foo"
foo
works fine.
from script file
--
#! /usr/bin/env python
#encoding:latin-1
print “foo”
--
get following error:
dans-air:~ dan$ python ./Documents/Python/Samples/foo.py
File "./Documents/Python/Samples/foo.py", line 3
print ?foo?
^
SyntaxError: invalid syntax
since this is 2.x Print "foo" should work but tried Print ("foo") get same error on quote mark.
file is saved as latin-1 encoding added encoding lines #.
can print integer from this file, print 6 results in 6 when file runs.
thanks,
Banging my head against the wall
on Mac
from the command prompt --
>>> Print "foo"
foo
works fine.
from script file
--
#! /usr/bin/env python
#encoding:latin-1
print “foo”
--
get following error:
dans-air:~ dan$ python ./Documents/Python/Samples/foo.py
File "./Documents/Python/Samples/foo.py", line 3
print ?foo?
^
SyntaxError: invalid syntax
since this is 2.x Print "foo" should work but tried Print ("foo") get same error on quote mark.
file is saved as latin-1 encoding added encoding lines #.
can print integer from this file, print 6 results in 6 when file runs.
thanks,
Banging my head against the wall
Comment