On 2009-08-08 19:34:44 -0400, "Alan Gauld" <alan.ga...@btinternet.com> said:


"pedro" <pedrooconn...@gmail.com> wrote


is one thing I am not really sure how to do. I want to be able to drop
a file onto a python script (or app I guess) and have the python script
use the path to the file that was dropped on it as sys.argv[1]

I may be wrong but I thought that, provided you had the path and
shebang etc set up properly that it just happened. Have you tried
a simpe script that just prints argv say?

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.
Pete






_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to