Skip to content

os

Execute shell command given by string. The value returned is actually the exit code, not the output of the command to STDOUT.

os.system('ls -la')
Store output in a variable
os.popen('ls -la').read()
Navigate filesystem
os.getcwd()
os.chdir(path)
Test for existence of a file
os.path.isfile(file)