[python] TIL how to use __doc__ and help()...
Posted: Sun Dec 09, 2012 4:22 pm
example:
gtk.Window().__doc__
help(["a","b","c"])
gtk.Window().__doc__
help(["a","b","c"])
The Descent Bulletin Board
https://descentbb.net/
Code: Select all
>>> def add(a, b):
... '''Given two numbers a and b, returns a + b.'''
... return a + b
...
>>> add.__doc__
'Given two numbers a and b, returns a + b.'
>>> help(add)