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.
click f5
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
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
f5
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
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.
Join our real-time social learning platform and learn together with your friends!