First of all, sorry for my english.
I have created my own file extension and bound it to my python
script with assoc
and ftype
:
assoc .iv=IV.Measurement
ftype IV.Measurement=python /path/to/my/script/myscript.py %1
It works like a charm.
But if I want to suppress the console it shows me a dialog to select default app to open my file and proposes python.exe
as default.
If I try:
ftype IV.Measurement=python /path/to/my/script/myscript.pyw %1
it works and shows me console.
If I try:
ftype IV.Measurement=pythonw /path/to/my/script/myscript.py %1
or
ftype IV.Measurement=pythonw /path/to/my/script/myscript.pyw %1
it makes me choose default app.
And if I choose pythonw.exe
as default it try to run my file as pythonw
app bypassing my script, like this:
pythonw my_iv_file.iv
In spite of this I can to run my app from cmd:
pythonw /path/to/my/script/myscript.pyw my_iv_file.iv
How can I bind my file extension to pythonw
? Thanks.
I was able to get it to work without displaying a console using these commands to associate the file type with the script:
The main things to note are I used a full paths to both
pythonw.exe
as well as tomyscript.pyw
, plus backslashes ("\"
) were used as path separator characters. You'll also need to enclose any paths in double quotes if they contain any space characters.Afterwards when
my_iv_file.iv
was double-clicked to open, the value ofsys.argv
inmyscript.pyw
was: