I am using IDLE on a Mac (10.9.5). How do I save my script for it to use the shell? Every time I run it (f5), it will run once, but my script will become a text document and wont run again. I tried saving it as a .py file but that didn't work either. Any ideas?
I did a quick test, and as long as the Python file is called as an argument of the Python interpreter, which is what it looks like IDLE does, it runs okay: python foo.py If you want the file to be executable, you need to add, as the first line: #!/usr/bin/python and make the file permissions allow execution: chmod +x foo.py Then if you're in the same directory, you can run it with: ./foo.py You can learn more about chmod by doing: man chmod
Yeah, I am having same problems the sample programs wont run on my windows 8 laptop. I am using execfile('C:/Users/iram/Downloads/lec03.py')
Join our real-time social learning platform and learn together with your friends!