On this page
  1. os.system
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

os.system

Prev: os.symlink | Up: os | Next: os.terminal_size
Rel: os.abort, os.access, os.chdir, os.chmod
Ref: docs.python.org — os.system
Tags: #public #python3 #stdlib #os


Import

import os
from os import system

Signature & Overview

os.system(command)

Execute the command in a subshell.

Usage

import os

rc = os.system("true") if os.name == "posix" else os.system("ver > NUL")
assert rc == 0

Gotchas

REPL Inspect

from os import system
help(system)

Linked from

Related notes