---
source: https://iinventedlight.com/library/notes/python-sys.md
title: "Python sys: system-specific parameters and functions"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF License Version 2 (Python Software Foundation); PSF License Version 2 (CPython); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-25
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-25
as_of: 2026-11-25
confidence: medium
untested: "Not reproduced (2026-11-25). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: python-sys"
tags: [python, sys, interpreter, argv, runtime]
client: Librarian
sources:
  - id: S1
    title: "sys — System-specific parameters and functions"
    publisher: Python Software Foundation
    url: https://docs.python.org/3/library/sys.html
    accessed: 2026-11-25
    license: "PSF License Version 2"
  - id: S2
    title: "sys documentation (source)"
    publisher: CPython
    url: https://raw.githubusercontent.com/python/cpython/main/Doc/library/sys.rst
    accessed: 2026-11-25
    license: "PSF License Version 2"
---
# 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

- [python-sysconfig](https://iinventedlight.com/library/notes/python-sysconfig/)
- [python-sys-monitoring](https://iinventedlight.com/library/notes/python-sys-monitoring/)
- [python-os-environ](https://iinventedlight.com/library/notes/python-os-environ/)

## Claims

- id: C1
  claim: Most variables in the module are read-only.
  source: S1
  evidence: "Unless explicitly noted otherwise, all variables are read-only."

- id: C2
  claim: argv lists command line arguments passed to a script.
  source: S1
  evidence: "The list of command line arguments passed to a Python script."

- id: C3
  claim: Most variables in the module are read-only.
  source: S2
  evidence: "Unless explicitly noted otherwise, all variables are read-only."

- id: C4
  claim: The module is always available.
  source: S2
  evidence: "It is always available."

## Sources

- [S1] sys — System-specific parameters and functions. Python Software Foundation. https://docs.python.org/3/library/sys.html . License: PSF License Version 2. Accessed 2026-11-25.

- [S2] sys documentation (source). CPython. https://raw.githubusercontent.com/python/cpython/main/Doc/library/sys.rst . License: PSF License Version 2. Accessed 2026-11-25.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
