Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
Importing and namespace visibility
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="jean-marc, post: 1819902"] As an application programmer, I'm not well versed in the material aspects of computing (memory, cpu, bus and all). My understanding of imports in Python is such: the __main__ program is the center piece which holds the programs reference: globals, functions, classes, modules etc. The objects of this file (functions and classes) are directly accessible; 'import suchModule' s objects are attainable through the *qualified name* (module.function); the 'from suchModule import *' the objects are directly attainable. A recent msg from F. Lundh [URL]http://groups.google.ca/group/comp.lang.python/browse_frm/thread/f9bf9734fa19eee9/8a51ab24748251d8?q=&rnum=12&hl=en#8a51ab24748251d8[/URL] suggested being careful with recursive importing... BUT, of all this I thought that if you import module1, then module2 (into __main__), objects from module1 would be available to objects of module2 which came (into memory space) after module1 was loaded. This does not seem to be the case, and module2 requires an 'import module1' statement in its own file to see this last module's objects. This is not the recursive situation that was a pitfall Fredrik was evoking. What am I missing here??? The reason I'm asking is to setup team development, using Tkinter, where different people will be programming diverse sections to be 'packed' into the main interface... Thanks for any help in understanding what is happening in this situation, JMD [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Importing and namespace visibility
Top