I
I
idr19952020-06-10 09:13:52
Python
idr1995, 2020-06-10 09:13:52

How to run python file in windows shell?

I created a file and saved it to my desktop.
file script1.py
def main():
print("this is our script test file")
main()

Run Power shell :
C: \Users\user> cd Desktop
C: \Users\user> cd Desktop > script1.py

Exits new line
C: \Users\user> cd Desktop >

This is our script test file

doesn't work What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2020-06-10
@SoreMix

What if python script.py?

A
AlexBoss, 2020-06-10
@AlexBoss

Did you put python in PATH?
Run happens python my_script.py

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question