Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 19 Online
OpenStudy (anonymous):

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?

OpenStudy (rsmith6559):

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

OpenStudy (anonymous):

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')

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!