Developing a Package with Sub Packages

Gabriel Genellina gagsl-py2 at
Mon Feb 18 21:02:36 CET 2008

En Mon, 18 Feb 2008 16:23:28 -0200, Josh English  
<joshua.r.english at> escribi�:

> When testing the package in idle, this results in
> C:\Python25\Lib\idlelib
> instead of the file.
> The Data folder is created in this folder now.

Works for me:
 from testpkg import a

testpkg directory (a subdirectory somewhere in sys.path):
(empty file)

import os
print __name__, __file__, os.path.abspath(os.path.dirname(__file__))

In IDLE: File -> Open, F5 (Run Module). Output:

testpkg.a C:\APPS\PYTHON25\lib\site-packages\testpkg\a.pyc

Gabriel Genellina

More information about the Python-list mailing list