Aug-18-2021, 05:27 AM
(Aug-18-2021, 01:16 AM)JaneTan Wrote: Or how do I find all the methods available in a Python library?
>>> import win32com.client as wc >>> >>> dir(wc) ['CDispatch', 'CLSIDToClass', 'CastTo', 'CoClassBaseClass', 'Constants', 'Dispatch', 'DispatchBaseClass', 'DispatchEx', 'DispatchWithEvents', 'EventsProxy', 'GetActiveObject', 'GetObject', 'Moniker', 'Record', 'VARIANT', 'WithEvents', '_PyIDispatchType', '__WrapDispatch', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_event_setattr_', '_get_good_object_', '_get_good_single_object_', 'build', 'constants', 'dynamic', 'gencache', 'getevents', 'pythoncom', 'pywintypes', 'sys'] >>> >>> dir(wc.constants) ['__class__', '__delattr__', '__dict__', '__dicts__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__'] >>> >>> help(wc.constants) Help on Constants in module win32com.client object: class Constants(builtins.object) | A container for generated COM constants. | | Methods defined here: | | __getattr__(self, a) | | __init__(self) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined)Using a good Editor(eg VS Code) or REPL function/method(with help) will automatic show when type
wc.