python里的dir很好用.呵呵

1 view
Skip to first unread message

google app engine

unread,
Dec 17, 2009, 1:36:36 AM12/17/09
to Google App Engine 中文开发组
>>> import BaseHTTPServer
>>> dir(BaseHTTPServer)
['BaseHTTPRequestHandler', 'DEFAULT_ERROR_CONTENT_TYPE',
'DEFAULT_ERROR_MESSAGE', 'HTTPServer', 'SocketServer', '__all__',
'__builtins__', '__doc__', '__file__', '__name__', '__package__',
'__version__', '_quote_html', 'catch_warnings', 'filterwarnings',
'mimetools', 'socket', 'sys', 'test', 'time']
就可以得到对象的属性名

>>>'sys' in dir(BaseHTTPServer)
True
>>>

Reply all
Reply to author
Forward
0 new messages