G
GertJanOurensma
hello,
I'm having problems suddenly running .py scripts from the command line. (CMD)
Before, *.py was associated with python.exe (The association was created during python installation, associating python scripts (.py) with the proper executable.
With the proper association of the .py file to python.exe , the location of the python.exe in the %PATH% variable - and the python extension in the %PATHEXT% , just typing '.\myscript.py' would launch the script in using the correct python.exe (using the CMD line)
However, for some reason this suddenly changed last week. Now, typing '.\myscript.py' does nothing - simply shows me the next prompt in the CMD window.
typing 'python myscript.py' still works, but since there are a load of batch files lingering around running the .py scripts without the explicit 'python' prefix - I have no idea what changed and i'd like to find out what's going on and fix this.
I browsed various forums - mentioning assoc and ftype, but these do not seem to do the trick
(in fact, on my tablet, typing .\myscript.py perfectly executes, and assoc/ftype seem to have nothing set for python scripts in the CMD window)
On the pc in question:
assoc .py returns 'Python.File' , ftype Python.File shows the path/python.exe to my python executable - yet when typing myscript.py in the CMD line, it does nothing.
I also tried associating the .py extension using the 'Run with' again, (was still showing 'python') but this too changed nothing.
I also checked the registry, to see what windows might be doing with .py extension, but although there are some references to the .py extension, some of which referring to the python.exe I like to use, it's hard to see what's going on there (not sure which registry items are or used for what or even if they are used in win10.)
I 'repaired' my python install - then completely reinstalled python (adding registry entries) but nothing changed.
when typing '.\myscript.py' on the command line - nothing happens, just the next prompt.
when double clicking the python script - it does seem to be associated with the proper python version, it does start using the right python.exe
My question(s)
- if possible, how do I see (using the cmd line) what is windows is actually doing (trying to do) when I type 'myscript.py' (can I start CMD using some debug/verbose options?)
- How/where in windows do i control how a .py script runs in the commandline? - apart from the 'run with' is there any way to tell windows how to run my python script, when I type myscript.py on the command line?
- are there additional options for the powershell to deal with this?
- is there a way, again from windows, to add details to the 'run with' , rather then just starting the .py using a python from the list, to tell it to use certain arguments?
- When using 'run with' , and seeing a python logo - is there a way to tell the exact path/execution line associated with that logo?
(if not, i really think it should be possible to see this when that list pops up using some advanced settings or something )
any help and insights would be much appreciated.
cheers
GJ
Continue reading...
I'm having problems suddenly running .py scripts from the command line. (CMD)
Before, *.py was associated with python.exe (The association was created during python installation, associating python scripts (.py) with the proper executable.
With the proper association of the .py file to python.exe , the location of the python.exe in the %PATH% variable - and the python extension in the %PATHEXT% , just typing '.\myscript.py' would launch the script in using the correct python.exe (using the CMD line)
However, for some reason this suddenly changed last week. Now, typing '.\myscript.py' does nothing - simply shows me the next prompt in the CMD window.
typing 'python myscript.py' still works, but since there are a load of batch files lingering around running the .py scripts without the explicit 'python' prefix - I have no idea what changed and i'd like to find out what's going on and fix this.
I browsed various forums - mentioning assoc and ftype, but these do not seem to do the trick
(in fact, on my tablet, typing .\myscript.py perfectly executes, and assoc/ftype seem to have nothing set for python scripts in the CMD window)
On the pc in question:
assoc .py returns 'Python.File' , ftype Python.File shows the path/python.exe to my python executable - yet when typing myscript.py in the CMD line, it does nothing.
I also tried associating the .py extension using the 'Run with' again, (was still showing 'python') but this too changed nothing.
I also checked the registry, to see what windows might be doing with .py extension, but although there are some references to the .py extension, some of which referring to the python.exe I like to use, it's hard to see what's going on there (not sure which registry items are or used for what or even if they are used in win10.)
I 'repaired' my python install - then completely reinstalled python (adding registry entries) but nothing changed.
when typing '.\myscript.py' on the command line - nothing happens, just the next prompt.
when double clicking the python script - it does seem to be associated with the proper python version, it does start using the right python.exe
My question(s)
- if possible, how do I see (using the cmd line) what is windows is actually doing (trying to do) when I type 'myscript.py' (can I start CMD using some debug/verbose options?)
- How/where in windows do i control how a .py script runs in the commandline? - apart from the 'run with' is there any way to tell windows how to run my python script, when I type myscript.py on the command line?
- are there additional options for the powershell to deal with this?
- is there a way, again from windows, to add details to the 'run with' , rather then just starting the .py using a python from the list, to tell it to use certain arguments?
- When using 'run with' , and seeing a python logo - is there a way to tell the exact path/execution line associated with that logo?
(if not, i really think it should be possible to see this when that list pops up using some advanced settings or something )
any help and insights would be much appreciated.
cheers
GJ
Continue reading...