Skip to content
UPEEC

Packaging, Imports and Code Tools

venv, ensurepip, importlib, ast, dis, tokenize, compileall, platform and ctypes.

Intermediate
Comments 0

This is an overview — pick a sub-topic below.

Sub-topics (7)

venv and ensurepip

Create isolated environments, and bootstrap pip into them.

Beginner♥ 0🔖 0💬 0

importlib

The import system as a library: import by name, reload modules, read package resources and metadata.

Intermediate♥ 0🔖 0💬 0

ast

Parse Python source into an Abstract Syntax Tree for analysis or transformation.

Advanced♥ 0🔖 0💬 0

dis and tokenize

Disassemble bytecode, and split source code into tokens.

Advanced♥ 0🔖 0💬 0

compileall

Pre-compile a directory of .py files to bytecode.

Intermediate♥ 0🔖 0💬 0

platform

Information about the OS, machine and Python build.

Beginner♥ 0🔖 0💬 0

ctypes

Call functions in C shared libraries (.dll / .so) directly from Python.

Advanced♥ 0🔖 0💬 0

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.