Home:ALL Converter>Python dir command to determine the methods

Python dir command to determine the methods

Ask Time:2012-09-23T02:08:57         Author:user1050619

Json Formatter

I am using Python's dir() function to determine what attributes and methods a class has.

For example to determine the methods in wx.Frame, I use dir(wx.Frame)

Is there any command to determine the list of arguments for each method? For example, if I want to know what arguments belong to wx.Frame.CreateToolBar().

Author:user1050619,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/12546406/python-dir-command-to-determine-the-methods
ely :

As mentioned in the comments, you can use help(fun) to enter the help editor with the function's signature and docstring. You can also simply use print fun.__doc__ and for most mature libraries you should get reasonable documentation about the parameters and the function signature.\n\nIf you're talking about interactive help, consider using IPython which has some useful extras. For instance you could type %psource fun to get a printout of the source code for the function fun, and with tab completion you could just type wx.Frame. and then hit TAB to see a list of all of the methods and attributes available within wx.Frame.",