python .bat wrapper

Dennis E. Hamilton infonuovo at email.com
Wed Feb 16 17:01:00 EST 2000


Very fun!  I am stealing that at once.

Try 

	python -x %0

and make life even easier!

-- orcmid

-----Original Message-----
From: python-list-admin at python.org
[mailto:python-list-admin at python.org]On Behalf Of Michal Wallace
Sent: Wednesday, February 16, 2000 00:18
To: python-list at python.org
Subject: python .bat wrapper


hey all....

I dunno if there's already something like this, but I
kinda missed perl's pl2bat... It added a little cruft
to a copy of your perl file to let dos run it as a batch.

Here's how to do it for python.. the only side-effect is
defining a global variable (but by convention, REM would
be a constant anyway, so it's no problem to just redeclare
it later..)

----------------------------
@echo off
REM = """
REM python -x skipped that first line...
REM make sure to change the next line to
REM whatever this file is called:

python -x test.bat
goto end
"""

# python code goes in here
print "hello, world!"


"""
:end """
----------------------------

cheers,

-Michal
http://www.sabren.com/



-- 
http://www.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list