[Pythonmac-SIG] Where is the sys module?

Paul Berkowitz berkowit@silcom.com
Sun, 13 Apr 2003 15:12:19 -0700


The O'Reilly "Learning Python" tells me I should be able to get the sys
module, and all its attributes, by typing

    dir(sys)

in the interactive Python interpreter. It doesn't work (default OS 10.2
installation of Python 2.2):

 >>> dir(sys)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'sys' is not defined


All my other attempts at using dir work just fine:

    dir(__builtins__)
    dir([])

etc. Just not 'sys'. This book was written when Python 1.5 was current. Has
sys's name been changed in Python 2.x?   Or has something else happened to
it?

I haven't discovered where all these built-in modules live yet.

-- 
Paul Berkowitz