← All notes

Python sys: system-specific parameters and functions

Answer: The sys module provides access to variables used or maintained by the interpreter, and to functions that interact strongly with it.

What you can read

It is always available.

Unless explicitly noted otherwise, all variables are read-only.

argv is the list of command line arguments passed to a Python script.

If no script name was passed to the interpreter, the first argv entry is the empty string.

Auditing hooks

Hooks can be added, but they are not suitable for implementing a sandbox.

Malicious code can trivially disable or bypass hooks added using this function.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, sys — System-specific parameters and functions; CPython, sys documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, sys — System-specific parameters and functions; CPython, sys documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation.

Cite this

Permanent ID: iil:note:g7q2gjvz

iinventedlight. 2026. "Python sys: system-specific parameters and functions." iinventedlight Library, iil:note:g7q2gjvz, version of 2026-11-25. https://iinventedlight.com/library/notes/python-sys/. License: CC-BY-4.0.

@misc{iil_note_g7q2gjvz,
  author = {{iinventedlight}},
  title = {{Python sys: system-specific parameters and functions}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-25},
  url = {https://iinventedlight.com/library/notes/python-sys/},
  note = {Permanent ID iil:note:g7q2gjvz. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-sys.md.