os module
The standard library module for talking to the operating system: environment variables, the current directory, files and processes.
In more detail
os.environ reads environment variables and os.getcwd() the current directory. For paths, pathlib is the modern choice over os.path.
Related terms
- environment variable — A named setting such as PORT=8000 that a program reads from its surroundings when it starts.
- pathlib — Python's standard library module for working with file paths as objects rather than plain strings.
- sys module — The standard library module through which a program asks the running interpreter about itself.
- subprocess module — The standard library module for running other programs from Python and collecting their output and exit code.
Taught in
- Where Python Lives: PATH And Versions — Hands-on Python: Complete Video Course & Book
- Composing Web Pages In Python — Hands-on Python: Complete Video Course & Book
- pip, requirements, and installing packages — Hands-on Python: Complete Video Course & Book
- A Standard Library Tour — Hands-on Python: Complete Video Course & Book