Getting File Permissions

Tim Chase python.list at tim.thechases.com
Tue Mar 7 08:56:46 EST 2006


> Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
> NameError: name 'octal' is not defined
> 
> Since I am new to python, can any one help me to solve this error?

Looks like you just want the oct() function (not "octal()")

 >>> [x for x in dir(__builtins__) if x.lower().find("oct") 
!= -1]
['oct']

The __builtins__ will tell you what functions python 
supports natively, and you can query against this list for 
patterns, as done above.

-tkc










More information about the Python-list mailing list