You can use win32com.client.gencache.EnsureDispatch
to generate Python code corresponding to the COM module. With this, you can use __dir__
to access the names of all methods (and chances are that your IDE uses __dir__
to auto-complete code so that you get that as well);
In [204]: from win32com.client.gencache import EnsureDispatch
In [205]: ver_parser = EnsureDispatch('Scripting.FileSystemObject')
In [210]: [a for a in ver_parser.__dir__() if '_' not in a]
Out[210]:
['CLSID',
'BuildPath',
'CopyFile',
'CopyFolder',
'CreateFolder',
'CreateTextFile',
'DeleteFile',
'DeleteFolder',
'DriveExists',
'FileExists',
'FolderExists',
'GetAbsolutePathName',
'GetBaseName',
'GetDrive',
'GetDriveName',
'GetExtensionName',
'GetFile',
'GetFileName',
'GetFileVersion',
'GetFolder',
'GetParentFolderName',
'GetSpecialFolder',
'GetStandardStream',
'GetTempName',
'MoveFile',
'MoveFolder',
'OpenTextFile']
Note that this only gets you the names of methods and not of properties (yet), but you can get those by hand:
In [213]: set(ver_parser._prop_map_get_).union(set(ver_parser._prop_map_put_))
Out[213]: {'Drives'}
Related Stack Overflow questions: