Re: Retrieve ext. variables in python program

2006-07-19 Thread alfa1234
Marc 'BlackJack' Rintsch skrev: > In <[EMAIL PROTECTED]>, alfa1234 wrote: > > > 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.a

Re: Retrieve ext. variables in python program

2006-07-19 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, alfa1234 wrote: > 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.

Re: Retrieve ext. variables in python program

2006-07-19 Thread alfa1234
Diez B. Roggisch skrev: > alfa1234 wrote: > > > Trying to convert TCL code to python. > > > > Have a property file from where I read some VAR's. Looks like this: > > EARPROJECT = sgs-procDist > > APPNAME = SGSProcedure > > > > > > In my TCL code I confirm the existence of the VAR = f.ex EARPROJEC

Re: Retrieve ext. variables in python program

2006-07-19 Thread alfa1234
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 G

Re: Retrieve ext. variables in python program

2006-07-19 Thread Diez B. Roggisch
alfa1234 wrote: > Trying to convert TCL code to python. > > Have a property file from where I read some VAR's. Looks like this: > EARPROJECT = sgs-procDist > APPNAME = SGSProcedure > > > In my TCL code I confirm the existence of the VAR = f.ex EARPROJECT by > using code: > > if { ([info exists

Re: Retrieve ext. variables in python program

2006-07-19 Thread alfa1234
[EMAIL PROTECTED] skrev: > alfa1234: > > Does anyone know and equalent way to confirm a Variable from the same > > property file using PYTHON code ??? > > Using globals(), locals(), and dir() you can find if your name exists > already. > > Bye, > bearophile Hi bearophile !! Thanks for the answer

Re: Retrieve ext. variables in python program

2006-07-19 Thread bearophileHUGS
alfa1234: > Does anyone know and equalent way to confirm a Variable from the same > property file using PYTHON code ??? Using globals(), locals(), and dir() you can find if your name exists already. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list