How to run a python script with a configuration file at command line?

S

steph_awk

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?
 
J

Jean-Michel Pichavant

Andreas said:
optparse

is your friend.

-aj

2010/6/3 steph_awk <[email protected]
<mailto:[email protected]>>

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://docs.python.org/library/configparser.html

JM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top