Issue
I'd been running code on my Windows desktop using Anaconda and 3.3.1. All good. Everything works.
When I tried running it on my laptop (also Windows, running the same versions), I keep getting SyntaxError: invalid syntax for anything I write. For example:
print ("Hello World")
>>> runfile(r'C:\Users\Laptopname\Desktop\.temp.py', wdir=r'C:\Users\Laptopname\Desktop')
File "<stdin>", line 1
runfile(r'C:\Users\Laptopname\Desktop\.temp.py', wdir=r'C:\Users\Laptopname\Desktop')
^
SyntaxError: invalid syntax
When I run it in IDLE, however, it works fine.
There's something wrong, I think, with the settings on Spyder. Any ideas?
Solution
This is not an answer, only an extended comment:
Open up a python interactive interpreter and type
with open(r'C:\Users\Laptopname\Desktop\.temp.py', 'rb') as f:
print(repr(f.read()))
Please post the output. (This will show us exactly what is in the file.)
Answered By - unutbu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.