Import module in Python with Examples - Guru99
www.guru99.com › import-module-pythonMar 05, 2022 · Using module alias in the import. You can also convert the module name to a shorter form by giving an alias name to it. The alias can be done using the keyword. Syntax: import filename as alias name The folder structure to test the code will be as follows: Mod test/ test.py display.py Following is the code inside test.py
Python AS Keyword - Python Examples
https://pythonexamples.org/python-asThe syntax to use as keyword to create an alias for importing a module is except <exception_name> as <alias_name> Example 1: Create Alias for Module In this example, we will create an alias for module numpy in the import statement with alias name np. Python Program import numpy as np a = np.array([4, 5, 3, 7]) print(a) Run Output [4 5 3 7]