scripts to run any command line that you can type in console windowos system runs shell command from python script os popen runs shell command and connects to its input or output streams in additionthe relatively new subprocess module provides finer-grained control over streams of spawned shell commands and can be used as an alternative toand even for the implementation ofthe two calls above (albeit with some cost in extra code complexitywhat' shell commandto understand the scope of the calls listed abovewe first need to define few terms in this textthe term shell means the system that reads and runs command-line strings on your computerand shell command means command-line string that you would normally enter at your computer' shell prompt for exampleon windowsyou can start an ms-dos console window ( "command prompt"and type dos commands there--commands such as dir to get directory listingtype to view filenames of programs you wish to startand so on dos is the system shelland commands such as dir and type are shell commands on linux and mac os xyou can start new shell session by opening an xterm or terminal window and typing shell commands there too--ls to list directoriescat to view filesand so on variety of shells are available on unix ( cshksh)but they all read and run command lines here are two shell commands typed and run in an ms-dos console box on windowsc:\pp \systemdir / helloshell py more py more pyc spam txt __init__ py type shell command line its output shows up here dos is the shell on windows :\pp \systemtype helloshell py python program print('the meaning of life'running shell commands none of this is directly related to pythonof course (despite the fact that python command-line scripts are sometimes confusingly called "shell tools"but because the os module' system and popen calls let python scripts run any sort of command that the underlying system shell understandsour scripts can make use of every command-line tool available on the computerwhether it' coded in python or not for examplehere introducing the os module