Changes

Jump to: navigation, search

OPS435 Python Lab 3

49 bytes added, 19:27, 2 June 2017
PART 2 - Running System Commands with Subprocess
import subprocess
</source>
:#To view the available modules and attributes to obtain non OS specific commandscommand-like information, issue the following:<source>
dir(subprocess)
</source>There are many available modules and attributes available as part of subprocess, we are interested in "'''Popen'''". This method subprocess.Popen() can be used to run system commands as a child process to the Python script. This below output will create a new child process, in Python we can control this through the new Python object we just created, "'''p'''". "'''p'''" now has a collection of methods(functions that are apart of a object) available, view them with '''dir()'''.<br><br>
13,420
edits

Navigation menu