Simple Modules Question

Akira Kiyomiya akira.kiyomiya at
Thu Apr 27 23:20:06 CEST 2000

I see NameError when I try to do string.atoi("45").

Is it because 'string' is at a different location??



from string import atoi    # imports 'string'
                                     # places atoi in current namespace
print atoi("12345")         # invokes 'atoi' without module name

string.atoi("45")             # NameError: string

More information about the Python-list mailing list