Win32 : Making script.py executable in DOS box

Olivier Dagenais olivierS.dagenaisP at canadaA.comM
Mon Jul 3 10:42:00 EDT 2000


How about a batch file called p.bat ?  (with optional status messages)

-----start p.bat--------
@echo off
echo Starting script '%1.py' ....
c:\progra~1\Python\python "%1.py" %2 %3 %4 %5 %6 %7 %8 %9
echo Execution complete!
----end p.bat-----------


Given you have a script called "spam.py":

-----start spam.py------
print "Spam spam spam spam"
-----end spam.py--------


Then, you would type:

c:\work\python\stuff>p spam
Starting script 'spam.py' ...
Spam spam spam spam
Execution complete!


Is that what you wanted??

--
----------------------------------------------------------------------
Olivier A. Dagenais - Carleton University - Computer Science III


"Neo Brave" <neo_brave at my-deja.com> wrote in message
news:8jp3pt$q7j$1 at nnrp1.deja.com...
> In article <WzI75.5714$Tb7.31718 at news-server.bigpond.net.au>,
>   "Mark Hammond" <MarkH at ActiveState.com> wrote:
> > Under Windows NT or Win2k, you can use the PATHEXT environment
> > variable. Simply add ".py" to the semi-colon sep'd list of
> > extensions, and off you go!
>
> Great, thats a help for NT, but I also want to do this on Win98 :-).
>
> > No solution I am aware of for 95, although there are some tricks
> > you can pull (Im sure someone else will fill these in for you)!
>
> Anyone???
>
> Neo
> --
> Neo Brave
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.





More information about the Python-list mailing list