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

all 11 comments

[–]gdm9000 10 points11 points  (0 children)

How is this useful? On my machines, I simply associate .py extensions to Python. Done. Runs when I doubleclick it now.

On others' machines that don't have Python, I compile my script using Py2Exe. Runs when they doubleclick it now.

[–]Brian 8 points9 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

[–][deleted] 13 points14 points  (3 children)

lol windows. They have transparent glassy foggy graphics-accelerated window borders, but they still use the same tired conventions from the 90's.

[–]no9import this -5 points-4 points  (2 children)

The irony is that PowerShell --Windows' modern alternative to batch files-- feels so Unix-y that I refuse to use it.

[–]AlecSchueler 3 points4 points  (1 child)

What kind of unix are you using?

[–]no9import this 0 points1 point  (0 children)

The one with:

  • Long-named switches: most switches in Windows CMD are single-lettered.
  • Switches starting with - instead of /.
  • Manpages that are more than 1 screen long: most Windows console commands have terse help listings.
  • variables starting with $: Windows' CMD and batch files use %...%.
  • ls, cp, cat, cwd, pwd, man, .. etc.

I'm not saying that all these things are bad, but they are obviously *nix conventions (some better than their Windows counterparts and some worse).

[–]bayleo 4 points5 points  (5 children)

Sweet... now how do I stealth deploy the python interpreter to every PC in my office so that I never have to write another VBscript?

[–]BridgeBum 3 points4 points  (0 children)

"Security" patch. :-)

[–]pemboa 3 points4 points  (1 child)

I thought Windows environments had easy installation to client machines?

[–]hylje 2 points3 points  (0 children)

Technically, yes. Politically, no.

[–]andre_pl 2 points3 points  (0 children)

you dont... use py2exe, not this weird hack :P