Ask coding questions

← Back to all posts
Imports?
AlfiePython (3)

What type of imports are there. E.g

import time
import os
import random

are there any more

Comments
hotnewtop
Coder100 (16872)

There's many, starting even from the stdlib:
look at the docs:
https://docs.python.org/3/library/index.html

and then there is even more by the community, click this cube:

and you can also import your own files
https://stackoverflow.com/questions/2349991/how-to-import-other-python-files

OldWizard209 (1091)

@AlfiePython There are literally thousands of imports. Importing is basically importing a Python Package that is in PyPi(Python Package INdex) which contains all the packages that are installable with Python. Here is the official PyPi Page. All the packages in there can be installed using pip install <package name> command in the shell or terminal;. Then you can import them. You can also create your own Package on repl.it and import like:

Let's say u create a file nameed python_package.py. You can import this in you main.py using import python_package And if you have a function called sample_function() in python_package.py, you can import only that function into main.py using from python_package import sample_funtion Hope this helps you

PS: Ping me if u need more help...