Thomas Guettler wrote:
> you could use '^(.*?)=(.*)$' as regex to parse each line
> group(1) is the variable name group(2) the value.
may I recommend:
key, value = line.split("=", 1)
--
http://mail.python.org/mailman/listinfo/python-list
Am Tue, 21 Dec 2004 07:51:53 -0800 schrieb biner:
> Hello,
>
> I have file called PARAMETRES that is used in bourne shell script to
> define variable. In order to do so I put a ". PARAMETRES" line and the
> script has acces to all the variable defined in the PARAMETRES file.
Hi,
you can run "
Hello,
I have file called PARAMETRES that is used in bourne shell script to
define variable. In order to do so I put a ". PARAMETRES" line and the
script has acces to all the variable defined in the PARAMETRES file.
Now, I would like to be able to get the same thing in python. I
googled and p