in a file called test.py I have the following
code
#!/usr/bin/python3
with
open('test.txt','w') as File:
print(1,file=File)
When I
do
$ python3
test.py
It runs fine. But when I
do
$ chmod +x test.py
$
./test.py
I get a
SyntaxError:
File "./test.py", line
4
print(1,file=File)
^
SyntaxError: invalid
syntax
Any one has any idea why?
Thank you
I'm running Python 3.3.1 in Ubuntu
13.04
No comments:
Post a Comment