[Tutor] still clarifying imorting

Jim Mooney cybervigilante at gmail.com
Tue May 21 03:43:04 CEST 2013


If I make a package called jimlib with __init__.py in it, and a
program called bark.py in it, and even put it in site packages, I
still have to import the program with   import jimlib.bark

But I noticed that the pygraphics package is in site packages, and has
media.py in it, and all I have to do with that is import media,
without qualifying it with pygraphics, as in import pygraphics.media

Why don't I have to drill down for media.py as I do with jimlib?

-- 
Jim Mooney

"And as he walked along he carried some things in his small sack. Some
were useless and some were not. But the useless things he prized most
of all."  --The Story of Dirtville


More information about the Tutor mailing list