diff --git a/your-first-python-program.html b/your-first-python-program.html index 5f9124b..c2d1c84 100755 --- a/your-first-python-program.html +++ b/your-first-python-program.html @@ -177,12 +177,12 @@ SyntaxError: non-keyword arg after keyword arg >>> sys.path ⑤ ['/home/mark/py', '', - '/usr/lib/python30.zip', - '/usr/lib/python3.0', - '/usr/lib/python3.0/plat-linux2@EXTRAMACHDEPPATH@', - '/usr/lib/python3.0/lib-dynload', - '/usr/lib/python3.0/dist-packages', - '/usr/local/lib/python3.0/dist-packages'] + '/usr/lib/python31.zip', + '/usr/lib/python3.1', + '/usr/lib/python3.1/plat-linux2@EXTRAMACHDEPPATH@', + '/usr/lib/python3.1/lib-dynload', + '/usr/lib/python3.1/dist-packages', + '/usr/local/lib/python3.1/dist-packages']
sys module makes all of its functions and attributes available.
sys.path is a list of directory names that constitute the current search path. (Yours will look different, depending on your operating system, what version of Python you’re running, and where it was originally installed.) Python will look through these directories (in this order) for a .py file whose name matches what you’re trying to import.
@@ -341,7 +341,7 @@ if __name__ == '__main__':
'humansize'
But you can also run the module directly as a standalone program, in which case __name__ will be a special default value, __main__. Python will evaluate this if statement, find a true expression, and execute the if code block. In this case, to print two values.
-c:\home\diveintopython3> c:\python30\python.exe humansize.py +c:\home\diveintopython3> c:\python31\python.exe humansize.py 1.0 TB 931.3 GiB
And that’s your first Python program! @@ -350,9 +350,9 @@ if __name__ == '__main__':
docstring from a great docstring.
-© 2001–9 Mark Pilgrim