


My package contains a number of scripts with command line options. I encountered the same problem but in the context of needing to package my code for Windows users (coming from Linux). Print("Hello, world!") # always use a comma for direct address Python.NoConFile="C:\Python32\pythonw.exe" "%1" %* Here are some instructive commands: C:\>echo %pathext% PYW as the last (lowest-priority) extensions, so the "before" and "after" values of PATHEXT were:īefore. pyw extensions is that the former opens a command prompt when run, and the latter doesn't. Note #1: command-prompt windows won't see the change w/o being closed and reopened. Under "system variables" scroll down until you see PATHEXTĮdit "Variable value" so that it contains. PYW) to the list of extensions in the PATHEXT environment variable. pyw) on the end of the file name, you need to add. HKEY_CLASSES_ROOT\py_auto_file\shell\open\commandĪdditionally, if you want to be able to run your python scripts without typing the. HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command The registry path may vary, use python26.exe or python.exe or whichever is already in the registry. Similarly, set HKEY_CLASSES_ROOT\py_auto_file\shell\open\command Set the HKEY_CLASSES_ROOT\Applications\python26.exe\shell\open\command What may help in that case is directly fixing the relevant registry keys for Python. Note that people who do that type of thing get their questions voted up, and they get reputation points, and more people are likely to help them with good answers.) Brought In From Comments:Įven if assoc and ftype display the correct information, it may happen that the arguments are stripped off. (Or post more helpful information in your question, like actual cut-and-paste copies of what you see in the console. Now you're in a position to figure out the rest of your problem for yourself. If you type the same thing, including the quotation marks, then you'll get results identical to when you just type "blah.py foo". So on my machine, when I type "blah.py foo", it will execute this exact command, with no difference in results than if I had typed the full thing myself:

It's associated with the file type "Python.File", so this command shows what it will be doing: Next, you need to know how Windows is executing things with that extension. First is to find out what kind of file Windows thinks it is: When you execute a script without typing "python" in front, you need to know two things about how Windows invokes the program.
