How do I run a python script from within the IDLE interactive shell?
The following throws an error:
>>> python helloworld.py SyntaxError: i
execFile('helloworld.py') does the job for me. A thing to note is to enter the complete directory name of the .py file if it isnt in the Python folder itself (atleast this is the case on Windows)
execFile('helloworld.py')
For example, execFile('C:/helloworld.py')
execFile('C:/helloworld.py')