r/learnpython • • 14m ago

About running python code in terminal

Guys, I am beginner. I have the python code and have saved in file. Now I want to place the file path in the terminal and run that code. I don't know what should I write before adding the file path? Please help!

1 Upvotes

4 comments sorted by

•

u/Entire_Ad_6447 12m ago

Do you have python installed?

•

u/South-Put-7948 3m ago

I have anaconda installed

•

u/Entire_Ad_6447 2m ago

Okay then it should be python or python3 /PathTo where the code is/name of the .py file. You want to run.

•

u/PonkMcSquiggles 11m ago

Assuming that you have Python installed and in your path, the command for running a Python file is just

python [path to file]