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

How do I run my program in the Python Shell without having to go to the editor to click the "Run Module" link? I saw the TA do this but couldn't see what he was doing to make it happen. In my shell, it doesn't automatically happen. This is in reference to the video: Recitation 1: Introduction to Coding Concepts.

OpenStudy (anonymous):

click f5

OpenStudy (da_scienceman):

on MAC and Linux, u can use sthg like #!/path/to/interpreter to show path to ur interpreter... then call urfile. or in windowns u might pass something like the following if u have not set the path to your compiler C:\Python27\python.exe C:\Users\Username\Desktop\my_python_script.py

OpenStudy (da_scienceman):

But usually. with linux (Ubuntu) u have it automatic path being set. So I guess u have to change to the folder of your script to run the file

OpenStudy (anonymous):

f5

OpenStudy (anonymous):

Go to location of your .py file you want to run (e.g. cd scripts/python_apps) and type python name_of_your_file.py Replace "name_of_your_file" with the actual name of your file

OpenStudy (anonymous):

Add: you do all this in your terminal [Linux/Mac] or cmd [Windows]. The system path to python installation has to be set in order for this to work.

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!