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
Packaging question
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="snorble, post: 4095537"] My question is, why do the modules bar and foo show up in mypack's dir()? I intend for Foo (the class foo.Foo) and Bar (the class bar.Bar) to be there, but was not sure about the modules foo and bar. My big picture intention is to create smaller modules, but more of them (like I am used to doing with C++), and then use a package to organize the namespace so I'm not typing out excessively long names and making the code less readable. Is that a reasonable approach to developing Python programs? $ ls mypack/*.py bar.py foo.py __init__.py $ cat mypack/__init__.py from foo import Foo from bar import Bar $ python Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.['Bar', 'Foo', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', 'bar', 'foo'] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Packaging question
Top