On Mon, Apr 13, 2009 at 11:59 AM, Ravi <ra.ravi....@gmail.com> wrote: > foo.py : > > i = 10 > > def fi(): > global i > i = 99 > > bar.py : > > import foo > from foo import i > > print i, foo.i > foo.fi() > print i, foo.i > > This is problematic. Well I want i to change with foo.fi() .
Why not only import foo and using foo.i? In fi() when you set i = 99 you are creating a new object called i in foo's namespace. -- David blog: http://www.traceback.org twitter: http://twitter.com/dstanek -- http://mail.python.org/mailman/listinfo/python-list