Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 2

39 bytes removed, 17:56, 25 May 2017
PART 2 - Arguments
print(sys.platform) # tells us our operating system platform
print(sys.argv) # tells us our arguments
sys.exit() # will immediately end our script when run, ignoring the remaining lines in the Python script</source>:#The Note that the '''sys.exit()' will immediately end the script on the line it is called, no other line in the script will ever be run. This '' function will be useful later in this lab, make sure you write it down in your notes.<br><br>
:#Create a new script '~/ops435/lab2/showargs.py' and place the following content inside<source>
#!/usr/bin/env python3
13,420
edits