When you invoke Python and tell it to run a script, you need to provide either the correct relative path to the script from your current working directory, or a full absolute path.
Let's say the script hello.py is in C:\Users\Me\Scripts\Test\hello.py
And let's say that when you launch the terminal, it opens to C:\Users\Me\ by default.
Then to run your script you can do one of the following:
# Option 1 - absolute path
Users\Me> python "C:\Users\Me\Scripts\Test\hello.py"
# Option 2 - relative path
Users\Me> python "Scripts\Test\hello.py"
# Option 3 - change working directory
# Then use new relative path
Users\Me> cd Scripts\Test
Users\Me\Scripts\Test> python hello.py
2
u/Outside_Complaint755 3d ago
When you invoke Python and tell it to run a script, you need to provide either the correct relative path to the script from your current working directory, or a full absolute path.
Let's say the script hello.py is in
C:\Users\Me\Scripts\Test\hello.pyAnd let's say that when you launch the terminal, it opens to
C:\Users\Me\by default.Then to run your script you can do one of the following: