python_modules_and_packages

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
python_modules_and_packages [2017/10/19 19:01] mguptonpython_modules_and_packages [2017/10/25 12:33] (current) – [Example] mgupton
Line 19: Line 19:
 from <package>.<sub package>.<module> import <function/class> from <package>.<sub package>.<module> import <function/class>
 </code> </code>
 +
 +The //__init__.py// could contain the following import statement.
 +
 +<code>
 +from <package>.<module> import <function/class>
 +</code>
 +
 +Which would allow the module to be imported into other modules with the following import statement that imports directly from the package and not the module.
 +
 +<code>
 +from <package> import <function/class>
 +</code>
 +
  • python_modules_and_packages.1508439685.txt.gz
  • Last modified: 2017/10/19 19:01
  • by mgupton