Alan Gauld wrote:
"pedro" <pedrooconn...@gmail.com> wrote
Well I made a script called droplet.py which looks like this:
#!/usr/bin/env python
# encoding: utf-8
import sys
theFilePath = sys.argv[1]
print theFilePath
But when I try to drop something on it nothing happens. Sorry I guess
there is something fundamental that I am missing.
Sorry, obviously I was wrong. FWIW in XP I get python to start up but
there is no filename in argv.
That depends on the file association settings for .py.
Start -> Settings -> Control Panel -> Folder Options -> File Types
Find py extension.
Click Advanced
Choose open
Click Edit
in my system I see "H:\Python30\python.exe" "%1" %*
which means fire up python.exe, pass the dropped file name as the first
argument.
BTW a nice 1 python line version independent droplet:
#!/usr/bin/env python
# encoding: utf-8
input(__import__('sys').argv)
--
Bob Gailer
Chapel Hill NC
919-636-4239
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor