[Tutor] drag-and-drop argument passing
alan.gauld@bt.com
alan.gauld@bt.com
Fri, 28 Jun 2002 14:03:01 +0100
------_=_NextPart_001_01C21EA4.22412640
Content-type: text/plain; charset="iso-8859-1"
> > Windows passes dragged files in as command line args.
> > I'm not so sure about multiple files tho' but try a
> > single file to see if that works first.
> I did try to do it before wailing for help, and I just can't ...
OK, Time to 'fess up... I've only done this with a Delphi app
which of course produces exes.
> I am using Windows XP, and I am just not allowed to drop anything onto
.py files.
Yes, the .py file is the command line argument to Python.
The file association says run python with this sript as
argument. What you need to do is somehow tell Windows
to run python taking this script plus whatever I dropped
as arguments, hmmm...
I just checked and the association is:
D:\Python20\python.exe "%1" %*
So the other args should pass thru'... strange.
> properties, but I see no equivalent to the Unix "execute" tag.
Its all in the file association stuff I think not the
security settings...
Now I'm interested, I'll need to do some digging.
Hopefully somebody else meantime knows the answer!
Not as easy as I thought.
Alan G.
------_=_NextPart_001_01C21EA4.22412640
Content-type: text/html; charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT color=#000080>><SPAN class=410153612-28062002><FONT
face="Courier New" color=#0000ff size=2> > </FONT></SPAN>Windows
passes dragged files in as command line args.</FONT><BR><FONT
color=#000080>><SPAN class=410153612-28062002><FONT face="Courier New"
color=#0000ff size=2> > </FONT></SPAN>I'm not so sure about
multiple files tho' but try a</FONT><BR><FONT color=#000080>><SPAN
class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2> > </FONT></SPAN>single file to see if that works
first.</FONT><BR><SPAN class=410153612-28062002><FONT face="Courier New"
color=#0000ff size=2><FONT face="Times New Roman" color=#000080 size=3>>
</FONT> </FONT></SPAN>I did try to do it before wailing for help, and I
just can't ... <SPAN class=410153612-28062002><FONT face="Courier New"
color=#0000ff size=2> </FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002></SPAN> </DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>OK, Time to 'fess up... I've only done this with a Delphi app
</FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>which of course produces exes.</FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=410153612-28062002>> </SPAN>I am using Windows XP, and
I am just not allowed to drop anything onto .py files. <SPAN
class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2> </FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>Yes, the .py file is the command line argument to
Python.</FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>The file association says run python with this sript as
</FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>argument. What you need to do is somehow tell Windows
</FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>to run python taking this script plus whatever I dropped
</FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>as arguments, hmmm...</FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>I just checked and the association is:</FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>D:\Python20\python.exe "%1" %*</FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>So the other args should pass thru'... strange.</FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2> > </FONT></SPAN>properties, but I see no equivalent to the
Unix "execute" tag.<BR><BR><SPAN class=410153612-28062002><FONT
face="Courier New" color=#0000ff size=2>Its all in the file association stuff I
think not the </FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>security settings... </FONT></SPAN><BR><BR><SPAN
class=410153612-28062002><FONT face="Courier New" color=#0000ff size=2>Now I'm
interested, I'll need to do some digging. </FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>Hopefully somebody else meantime knows the
answer! </FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>Not as easy as I thought.</FONT></SPAN></DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=410153612-28062002><FONT face="Courier New" color=#0000ff
size=2>Alan G.</FONT></SPAN></DIV></BODY></HTML>
------_=_NextPart_001_01C21EA4.22412640--