Global Variable

Xiao-Qin Xia xx758 at cam.ac.uk
Tue Apr 30 06:00:23 EDT 2002


Hello,

If a module (for example, gmpy) is imported in the main.py, how can it be 
used by other modules (for example, mymodule) without being imported by 
each of the other modules? 

#---------main.py---------
import gmpy
import mymodule
...


#--------mymodule.py---------
#I want use gmpy here, do I have to import it again? can main.py add gmpy 
into a global dict?


Thanks,
Xiao-Qin



More information about the Python-list mailing list