Hi, I didn't get any response on help-python.org so I figured I try these lists if I have the follwoing packages hierarchy A/ __init__.py B/ __init__.py C.py I can use: >>> from A.B import C but if I use: >>> import A >>> print A <module 'A' from 'A/__init__.pyc'> >>> from A import B print B <module 'A.B' from 'A/B/__init__.py'> >>> from B import C Traceback (innermost last): File "<stdin>", line 1, in ? ImportError: No module named B in order to get this to work I have to >>> import sys >>> sys.modules['B'] = B Is that expected ? In the documentation I read: "from" module "import" identifier so I expected "from B import C" to be legal since B is a module I tried this with Python 1.5.2 and 2.0 on an sgi under IRIX6.5 Thanks for any help -Michel -- ----------------------------------------------------------------------- >>>>>>>>>> AREA CODE CHANGE <<<<<<<<< we are now 858 !!!!!!! Michel F. Sanner Ph.D. The Scripps Research Institute Assistant Professor Department of Molecular Biology 10550 North Torrey Pines Road Tel. (858) 784-2341 La Jolla, CA 92037 Fax. (858) 784-2860 sanner@scripps.edu http://www.scripps.edu/sanner -----------------------------------------------------------------------
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4