A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/118210.html below:

Self descibing scripts

Self descibing scriptsFredrik Lundh fredrik at pythonware.com
Mon Apr 2 09:31:48 EDT 2001
Neil Benn wrote:

>             I'm looking at a way to make pyhton scripts self describing.
> I'm thinking of something similar to java's reflection.
>
>     Has anyone tried this, I could code a list to be returned of the
> functions in the script but that's a bit messy - any help/ideas would be
> greatly appreciated!

how about dir?

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

Cheers /F



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4