Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Package Use

If the __init__ module in a package is empty, the package is little more than a collection of module files. In this case, we don't generally make direct use of a package. We merely mention it in an import statement: import cards.poker.

On other hand, if the __init__ module has some definitions, we can import the package itself. Importing a package just imports the __init__ module from the package directory. In this case, we mention the package in an import statement: import cards.

Even if the __init__ module has some definitions in it, we can always import a specific module from within the package. Indeed, it is possible for the __init__ module in a package is to do things like adjust the search path prior to locating individual module files.


 
 
  Published under the terms of the Open Publication License Design by Interspire