On Thu, 05 Feb 2004 13:39:53 -0800, se7en wrote:
I have this file x.py and I need to execute it with y.met as an
argument. Unsure of syntax etc...
-Python newbie
Use:
import sys
filename = sys.argv[1]
print filename
Usage:
python x.py y.met
(sys.argv is a list where the first entry (i.e. sys.argv[0]) is
the name of your Python script and the other entries are the
command line arguments which you passed to your script.)
HTH / Nuff