I have a small problem with one of my scripts currently, I'm using the 
config parser to open a config.ini file, but this program is going to be 
designed to be used as a cron job, currently i made a work around.. 
./program.py config.ini is how you run it from the command line

I'm looking for an easy way to find the current directory location of my 
program so I can include the config.ini file correctly without having to 
pass command line args.

here is my work around,

try:
  config.readfp(open(argv[1]))
except (IndexError, IOError):
  print "Config.ini file not found."
  exit()



thanks!


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

Reply via email to