Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Run python script from Command Prompt

I know how to run a python script from the python idle but I can’t figure out how to run it from the terminal.

I thought that it might work by using "run test.py"

print("Hello World")
print("This is a test")
print(1+1)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

To run a python script, you just have to write python YOUR FILE HERE.py But before doing this, remember to set the location of command prompt to the location of your file using the command cd YOUR FILE ADDRESS

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading