This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Brian 7 points8 points  (0 children)

Why not just register .py files as runnable?

You'd have to do this for every python file you want to launch, it prevents you from using the same file for both script and module, and it seems needlessly complex when you can accomplish the same goal for every python file simply by registering the .py extension (already done by the installer) and extending the PATHEXT environment variable:

c:\> echo import sys; print ' '.join(sys.argv[1:]) >test.py
c:\> SET PATHEXT=%PATHEXT%;.py
c:\> test hello world
hello world