Home
Original page
How "import" and "from" work?
❮
Python modules are compiled
Execute at import time
❯
import
Find the file to load.
Compile to bytecode if necessary and save the bytecode if possible.
Run the code of the file loaded.
Copy names from the imported module to the importing namespace.
Index (i)
Table of Contents (t)
Indexed keywords (k)
Chapter TOC (d)
Hide/Show (h)