Re: exec globals and locals

2009-09-02 Thread John Nagle
Chris Rebert wrote: On Wed, Sep 2, 2009 at 4:54 AM, Quentin Lampin wrote: Hi, Being fairly new to Python, I'm trying to figure out the best way to use the exec statement and I must admit that I am a bit lost. Generally, if you want to use the exec statement, you're probably lost. Unless yo

Re: exec globals and locals

2009-09-02 Thread Quentin Lampin
2009/9/2 Chris Rebert > On Wed, Sep 2, 2009 at 1:13 PM, Quentin Lampin > wrote: > > 2009/9/2 Chris Rebert > >> > >> On Wed, Sep 2, 2009 at 4:54 AM, Quentin Lampin > > >> wrote: > >> > Hi, > >> > Being fairly new to Python, I'm trying to figure out the best way to > use > >> > the > >> > exec sta

Re: exec globals and locals

2009-09-02 Thread Chris Rebert
On Wed, Sep 2, 2009 at 1:13 PM, Quentin Lampin wrote: > 2009/9/2 Chris Rebert >> >> On Wed, Sep 2, 2009 at 4:54 AM, Quentin Lampin >> wrote: >> > Hi, >> > Being fairly new to Python, I'm trying to figure out the best way to use >> > the >> > exec statement and I must admit that I am a bit lost. >>

Re: exec globals and locals

2009-09-02 Thread Quentin Lampin
2009/9/2 Chris Rebert > On Wed, Sep 2, 2009 at 4:54 AM, Quentin Lampin > wrote: > > Hi, > > Being fairly new to Python, I'm trying to figure out the best way to use > the > > exec statement and I must admit that I am a bit lost. > > > > Consider this case: > > exec "print 'a'" in {},{} [exp.1]

Re: exec globals and locals

2009-09-02 Thread Chris Rebert
On Wed, Sep 2, 2009 at 4:54 AM, Quentin Lampin wrote: > Hi, > Being fairly new to Python, I'm trying to figure out the best way to use the > exec statement and I must admit that I am a bit lost. > > Consider this case: > exec "print 'a'" in {},{}   [exp.1] > It means  that I'm (kindly) asking the i

exec globals and locals

2009-09-02 Thread Quentin Lampin
Hi, Being fairly new to Python, I'm trying to figure out the best way to use the exec statement and I must admit that I am a bit lost. Consider this case: exec "print 'a'" in {},{} [exp.1] It means that I'm (kindly) asking the interpreter to execute the code string "print 'a'" with empty globa