I am trying to run a python script from CMD (let's say sample.py) and I have added the directory of sample.py to my PATH. When I run "sample.py" in CMD it opens the file in my editor meaning it recognizes it. However, when I run "python sample.py" (python.exe added to path) I get the error:
python: can't open file 'sample.py': [Errno 2] No such file or directory".
Why does sample.py not run with python
but opens otherwise? I am using a Windows machine.