Creating Python "executables" on Windows?

Alan Gauld alan.gauld at gssec.bt.co.uk
Tue Aug 22 10:12:00 EDT 2000


Hrvoje Niksic wrote:
> > If you need to provide args then thats harder, you'd need
> > to get the args by prompts using input/raw_input
> 
> This is a problem: the thing is, I am trying to write a small,
> Unix-style program that processes its command-line arguments.  Reading
> data with raw_input() would render it pretty much unusable.
> 
> I guess I'll have to go with the wrapper; thanks for your help.

I just tried it and typing the python script name at the
Start|Run prompt works.

ie typing:

C:\tmp.py this parrot is dead

produces:
this
parrot
is
dead
Hit enter to exit!

In a DOS box for the following script, tmp.py:

import sys
if len(sys.argv) > 1:
  for i in sys.argv
     print i
raw_input("Hit enter to exit!")

So assuming the installer has set up the associations 
correctly you can just run it from the Run dialog.

Alan G.

PS This is on NT but I see no reason to think W9x would 
be different in this.

-- 
=================================================
This post represents the views of the author 
and does not necessarily accurately represent 
the views of BT.



More information about the Python-list mailing list