Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 3

124 bytes added, 13:03, 10 August 2017
PART 2 - Running System Commands with Subprocess
== PART 2 - Running System Commands with Subprocess ==
:The remainder of this lab investigation will allow you to run operating system commands via your Python script. Although there are different ways in which to issue operating system commands, you will learn how to issue them within a Python script to run in a secure manner regardless of the type of operating system platform (eg Linux, Windows, MacOSX).
'''Perform the Following Steps:'''
system(whoami)
system(ifconfig)
</source> You should notice the output from your the Linux commands that you issuedcalled is not printed to the console automatically, it's printed by ipython only. Make sure you understand the difference.<br><br>
:#Issue the following in ipython:<source>
system(ipconfig)