Primary
os.system() ⚬|Documentation|1st|20251021005714-00-⌔
os#os.system — Miscellaneous operating system interfaces — Python 3 documentation
os— Miscellaneous operating system interfacesSource code: Lib/os.py
This module provides a portable way of using operating system dependent functionality. If you just want to read or write a file see
open(), if you want to manipulate paths, see theos.pathmodule, and if you want to read all the lines in all the files on the command line see thefileinputmodule. For creating temporary files and directories see thetempfilemodule, and for high-level file and directory handling see theshutilmodule.Notes on the availability of these functions:
- The design of all built-in operating system dependent modules of Python is such that as long as the same functionality is available, it uses the same interface; for example, the function
os.stat(path)returns stat information about path in the same format (which happens to have originated with the POSIX interface).- Extensions peculiar to a particular operating system are also available through the
osmodule, but using them is of course a threat to portability.- All functions accepting path or file names accept both bytes and string objects, and result in an object of the same type, if a path or file name is returned.
- On VxWorks, os.popen, os.fork, os.execv and os.spawn﹡p﹡ are not supported.
- On WebAssembly platforms, Android and iOS, large parts of the
osmodule are not available or behave differently. APIs related to processes (e.g.fork(),execve()) and resources (e.g.nice()) are not available. Others likegetuid()andgetpid()are emulated or stubs. WebAssembly platforms also lack support for signals (e.g.kill(),wait()).Note: All functions in this module raise
OSError(or subclasses thereof) in the case of invalid or inaccessible file names and paths, or other arguments that have the correct type, but are not accepted by the operating system.Printed 2026-06-28.
(echo:: @ ᯤ)
Link to original
Secondary
• • •