Not defined

Pekka Karjalainen pkarjala at paju.oulu.fi
Sat Oct 1 13:56:05 CEST 2005


In article <RVq%e.15439$iM2.1260547 at news.xtra.co.nz>, Rob wrote:
>Forgive me please if this is not the proper place for this ?  I am trying to 
>keep an active brain :)

Seems proper to me :)

You can see what you've just imported by using the built-in
dir() function. Here's an example from my PyWin window:

>>> dir()
['__builtins__', '__doc__', '__name__', 'pywin']
>>> from math import *
>>> dir ()
['__builtins__', '__doc__', '__name__', 'acos', 'asin', 'atan', 'atan2',
'ceil', 'cos', 'cosh', 'degrees', 'e', 'exp', 'fabs', 'floor', 'fmod',
'frexp', 'hypot', 'ldexp', 'log', 'log10', 'modf', 'pi', 'pow', 'pywin',
'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh']
>>> 

Note that the first time I use dir() it lists just four items. After from
math import * it lists all the stuff I got from the math module in
addition.

How does your dir() look after the import statement?

-- 
Pekka Henrik Karjalainen




More information about the Python-list mailing list