From: steph_awk on
I have been searching for quite some times without success.

I have a python script that needs to start from command line and it
should have a config file to fill out the detais (itis one program,
and many possible configurations).

something as simple as PHP would be nice %> ./PHPscript -c configfile

is there such a thing in Python?
From: steph_py on
On Jun 3, 12:50 pm, Jean-Michel Pichavant <jeanmic...(a)sequans.com>
wrote:
> Andreas Jung wrote:
> > optparse
>
> > is your friend.
>
> > -aj
>
> > 2010/6/3 steph_awk <stephane.laroche...(a)gmail.com
> > <mailto:stephane.laroche...(a)gmail.com>>
>
> >     I have been searching for quite some times without success.
>
> >     I have a python script that needs to start from command line and it
> >     should have a config file to fill out the detais (itis one program,
> >     and many possible configurations).
>
> >     something as simple as PHP would be nice  %> ./PHPscript -c configfile
>
> >     is there such a thing in Python?
> >     --
> >    http://mail.python.org/mailman/listinfo/python-list
>
> http://docs.python.org/library/configparser.html
>
> JM

configparser is fine if you know the name of the config file, but my
scripts has many config files, I want to pass one by command line
instead of hard coding every possibilities. This may be run as a cron
job, which would automaticaly call up the proper config file depending
on the database...