Retrieve ext. variables in python program

alfa1234 heliflyer at hotmail.com
Wed Jul 19 15:52:20 EDT 2006


Hi Diez !!
Thanks for the reply.. Tried a little well dokumented program:

# file: construct.ini
retries = 10

# file: construct.py
import cfgparse
c = cfgparse.ConfigParser()
c.add_option('retries', type='int')
c.add_file('construct.ini')
opts = c.parse()
print 'Number of retries:',opts.retries

Got the following Error when trying to run code:
[wsadmin] Traceback (innermost last):
[wsadmin]   File "<string>", line 1, in ?
[wsadmin] ImportError: no module named cfgparse




More information about the Python-list mailing list