Imports in python are static, any solution?

Ravi ra.ravi.rav at gmail.com
Mon Apr 13 11:59:19 EDT 2009


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() .



More information about the Python-list mailing list