Basic Python 28: Modules | Python

Published: 05 October 2022
on channel: Testing Tutorialspoint
15
5

Python Modules:
-------------------------
What are modules in Python?

Modules refer to a file containing Python statements and definitions.

A file containing Python code, for example: example.py, is called a module, and its module name would be example.

How to import modules in Python?

We can import the definitions inside a module to another module or the interactive interpreter in Python.

We use the import keyword to do this. To import our previously defined module example

ex:
import example

example.add(4,5.5)

Python import statement:
------------------------
import math
print("The value of pi is", math.pi)

Import with renaming:
---------------------
import math as m
print("The value of pi is", m.pi)

Python from...import statement:
-------------------------------
from math import pi
print("The value of pi is", pi)

Import all names:
-----------------
from math import *
print("The value of pi is", pi)
__________________ API Automation _________________
➡️ Rest Assured Using Java →    • Rest Assured  
➡️ Karate Framework using Maven →    • Karate Framework Using Maven Project  
_____________ Programing Language ____________________
➡️ Basic Python →    • Basic Python  
➡️ Core Java →    • CoreJava  
___________ Performances Testing ___________________
➡️ JMeter Beginner →    • JMeter Beginner  
➡️ Locust Beginner →    • Locust  
___________ Git and GitHub _____________________________
➡️ Git and GitHub Beginner →    • Git and GitHub Beginner  

_____________Manual Testing ____________________
➡️ Manual Testing →    • Manual Testing  

______________Automation Testing __________________
➡️ Selenium Cucumber Framework using Java →    • Selenium Cucumber BDD Framework with Java ...  
➡️ Robot Framework with Python →    • Python With Robot Framework  
➡️ Beginner Karate Framework using Intellij →    • Karate Framework Beginner  
➡️ Karate Framework with Gradle using eclipse →    • Karate Framework using Gradle Project  
➡️ Basic Selenium WebDriver using Java →    • Selenium WebDriver  
➡️ TestNG Framework →    • TestNG Framework  
➡️ Robot Framework with RIDE →    • RIDE With Robot Framework  
________________ Beginner Jenkins ____________________
➡️ Beginner Jenkins →    • Beginner Jenkins  


On this page of the site you can watch the video online Basic Python 28: Modules | Python with a duration of hours minute second in good quality, which was uploaded by the user Testing Tutorialspoint 05 October 2022, share the link with friends and acquaintances, this video has already been watched 15 times on youtube and it was liked by 5 viewers. Enjoy your viewing!