John Nagle wrote: > On 4/22/2012 12:39 PM, mambokn...@gmail.com wrote: >> Question: >> How can I access to the global 'a' in file_2 without resorting to the >> whole name 'file_1.a' ? > > Actually, it's better to use the fully qualified name "file_1.a". > Using "import *" brings in everything in the other module, which often > results in a name clash. > > Just do > > import file_1 > > and, if desired > > localnamefora = file_1.a
I think it is better to write from file_1 import a as localnamefora instead, unless `localnamefora' should be the identifier of a (function-)local variable. <http://docs.python.org/release/2.7.3/reference/simple_stmts.html#the- import-statement> <http://docs.python.org/py3k/reference/simple_stmts.html#the-import- statement> -- PointedEars Please do not Cc: me. / Bitte keine Kopien per E-Mail. -- http://mail.python.org/mailman/listinfo/python-list