Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 2

15 bytes added, 17:45, 25 May 2017
PART 2 - Arguments
'''Perform the following steps
:#In order to read arguments in Python, we will need to '''import special variables ''' from the system. This is a standard 'library' of code provided by the developers of Python. By issuing '''import sys''', you have loaded code written by another person, each 'library' that gets loaded will give us extra functionality in our program. This is done by isuing issuing the import sys function within your ipython3 shell. :#Issue following to access your ipython3 shell and import special variables:<source>
ipython3
import sys
</source>
:#This is a standard 'library' of code provided by the developers of Python. By typing 'import sys' we have loaded code written by another person, each 'library' that gets loaded will give us extra functionality in our program.
:#To inspect this library and look at all that it contains we can use the 'dir()' function. This can be used to inspect any library(and more) looking at all the functions and values contained within.<source>
dir(sys)
13,420
edits