Windows - Drag & drop on Python script?

Greg Ewing greg.ewing at compaq.com
Thu Jun 24 20:50:06 EDT 1999


Well, I don't know what went wrong yesterday, but
I tried the same thing again today, and it worked
fine. Drag a file onto a .bat and it comes in as
%1.

Another question - what is the recommended way of
getting the effect of a unix #!? I came up with:

python -x %0 %1
exit
<python code here>

which only works by the serendipitous fact that
there is an 'exit' defined in the python builtins.
Without the exit, after the python finishes, the
shell goes on to try and interpret it as msdos
commands!

Is there a more elegant way to do this?

Another other question - what is the "Batch File"
box in the Properties dialog of a .bat file for?
If you put the name of another .bat file there,
it gets executed before the main file. But what
is its purpose? Just curious.

Greg




More information about the Python-list mailing list