Basilevs
0
Q:

modules in python

#use import statement to import modules
import random
r = random.randint(1,10)
#use from-import statements to import functions
from random import randint
r = randint(1,10)
#use from module import * statement to import all functions
from random import *
r = randint(1,10)
1
import  pandas as pd:
1
import numpy as np:
1
#There are a lot of Python modules, and this is not a complete list
#However, these are the most common/useful ones I can find
#builtins
import random,math,time,os,turtle,json,tkinter,re
#use pip to install
import pygame,pyautogui,PIL,django
5
A package is basically a directory with Python files and a file with the name __init__.py
1
import pyttsx3 # using ptython  to convert  text to speech 
0
from pakage_name.module_name import function_name
# now we can directly use function

##################################  OR  ########################################

from pakage_name import module_name
# now we have to use module_name.function_name
0

New to Communities?

Join the community