Re: imported var not being updated

2010-03-09 Thread John Posner
On 3/9/2010 9:48 AM, Bruno Desthuilliers wrote: John Posner a écrit : On 3/8/2010 11:55 PM, Gary Herron wrote: The form of import you are using from helpers import mostRecent makes a *new* binding to the value in the module that's doing the import. What you can do, is not make a separate

Re: imported var not being updated

2010-03-09 Thread Gary Herron
John Posner wrote: On 3/8/2010 11:55 PM, Gary Herron wrote: The form of import you are using from helpers import mostRecent makes a *new* binding to the value in the module that's doing the import. What you can do, is not make a separate binding, but reach into the helpers module to get t

Re: imported var not being updated

2010-03-09 Thread Bruno Desthuilliers
John Posner a écrit : On 3/8/2010 11:55 PM, Gary Herron wrote: The form of import you are using from helpers import mostRecent makes a *new* binding to the value in the module that's doing the import. What you can do, is not make a separate binding, but reach into the helpers module to ge

Re: imported var not being updated

2010-03-09 Thread John Posner
On 3/8/2010 11:55 PM, Gary Herron wrote: The form of import you are using from helpers import mostRecent makes a *new* binding to the value in the module that's doing the import. What you can do, is not make a separate binding, but reach into the helpers module to get the value there. Like

Re: imported var not being updated

2010-03-09 Thread Benjamin Kaplan
On Tue, Mar 9, 2010 at 9:18 AM, John Posner wrote: > On 3/8/2010 11:55 PM, Gary Herron wrote: > > > >> The form of import you are using >> from helpers import mostRecent >> makes a *new* binding to the value in the module that's doing the >> import. >> > > > > > What you can do, is not make a

Re: imported var not being updated

2010-03-08 Thread Alex Hall
Thanks, it worked as expected. I guess I figured that Python would read my mind and realize that I wanted mostRecent to act globally for the program, imported as a copy or accessed in its own namespace (right term?) Oh well, the day computers can read thoughts like that is the day programmers are o

Re: imported var not being updated

2010-03-08 Thread Gary Herron
Alex Hall wrote: Hello all: I have a project with many pyw files. One file holds a variable and a function that I find myself using across many other pyw files, so I called it helpers.pyw. The variable is "mostRecent", which is a string and is meant to hold a string so I know what the program mos

imported var not being updated

2010-03-08 Thread Alex Hall
Hello all: I have a project with many pyw files. One file holds a variable and a function that I find myself using across many other pyw files, so I called it helpers.pyw. The variable is "mostRecent", which is a string and is meant to hold a string so I know what the program most recently output;