Wednesday, 1 March 2017

Python 3 Import Usage


Python 3 Import Usage

The below are some valid python import usage for which

'''Example for normal import which imports all the classes present'''
import module_name

'''Example for importing a class inside a package or module'''
from module_name import function_name

'''Example for importing with alias'''
from module_name import function_name as alias_name

id = alias_name.method.param

No comments:

Post a Comment