Re: reading raw variables from file

2007-12-02 Thread Martin Blume
"MonkeeSage" schrieb > > > > If I have understood python naming scoping correctly, > > doing > >my_var="hello" > >import stuff > >print my_var > > is not the same as > >my_var="hello" > >exec open("stuff.py").read() > >print my_var > > with stuff.py containing > >my_var

Re: reading raw variables from file

2007-11-30 Thread MonkeeSage
On Nov 30, 10:05 am, "Martin Blume" <[EMAIL PROTECTED]> wrote: > "Bruno Desthuilliers" schrieb > > > > > >> I have a file that might contain literal python > > >> variable statements at every line. For example > > >> the file info.dat looks like this: > > >> users = ["Bob", "Jane"] > > >> status =

Re: reading raw variables from file

2007-11-30 Thread Martin Blume
"Bruno Desthuilliers" schrieb > >> I have a file that might contain literal python > >> variable statements at every line. For example > >> the file info.dat looks like this: > >> users = ["Bob", "Jane"] > >> status = {1:"ok",2:users[0]} > >> the problem is I want to read this file and load >

Re: reading raw variables from file

2007-11-30 Thread Francesco Guerrieri
On Nov 30, 2007 5:57 AM, Astan Chee <[EMAIL PROTECTED]> wrote: > Hi, > I have a file that might contain literal python variable statements at > every line. For example the file info.dat looks like this: > users = ["Bob", "Jane"] > status = {1:"ok",2:users[0]} > the problem is I want to read this fi

Re: reading raw variables from file

2007-11-30 Thread Bruno Desthuilliers
Martin Blume a écrit : > "Astan Chee" schrieb >> I have a file that might contain literal python >> variable statements at every line. For example >> the file info.dat looks like this: >> users = ["Bob", "Jane"] >> status = {1:"ok",2:users[0]} >> the problem is I want to read this file and load

Re: reading raw variables from file

2007-11-30 Thread Martin Blume
"Astan Chee" schrieb > I have a file that might contain literal python > variable statements at every line. For example > the file info.dat looks like this: > users = ["Bob", "Jane"] > status = {1:"ok",2:users[0]} > the problem is I want to read this file and load > whatever variables written in

Re: reading raw variables from file

2007-11-29 Thread Astan Chee
Paddy wrote: On Nov 30, 4:57 am, Astan Chee <[EMAIL PROTECTED]> wrote: Hi, I have a file that might contain literal python variable statements at every line. For example the file info.dat looks like this: users = ["Bob", "Jane"] status = {1:"ok",2:users[0]} the problem is I want to read this

Re: reading raw variables from file

2007-11-29 Thread Paddy
On Nov 30, 4:57 am, Astan Chee <[EMAIL PROTECTED]> wrote: > Hi, > I have a file that might contain literal python variable statements at > every line. For example the file info.dat looks like this: > users = ["Bob", "Jane"] > status = {1:"ok",2:users[0]} > the problem is I want to read this file an

reading raw variables from file

2007-11-29 Thread Astan Chee
Hi, I have a file that might contain literal python variable statements at every line. For example the file info.dat looks like this: users = ["Bob", "Jane"] status = {1:"ok",2:users[0]} the problem is I want to read this file and load whatever variables written in it as normal python variable st