[Tutor] importing
Isaac Hall
hall@ouhep1.nhn.ou.edu
Tue Jun 24 15:15:07 2003
alright, this is kind of an odd question, and Im not sure that there is
another way I can go about doing this.
I have a program that I would like to call with one or more than one
configuration files in the command line. For what I want, the easiest way
to create these configuration files was just to make them a collection of
python dictionaries. This way I figured I wouldnt have to waste time
creating some method to read a configuration file. However I found that
putting in a statement like:
try:
import sys.argv[1]
except:
print 'bad config file'
doesnt quite work. Does anyone know if there are clever ways to import a
file that can be specified in the command line?
thanks
Ike
--