0

Powershell --> Python : Object Members

I completely understand that these are two very different scripting world's, however maybe there's a module out there that can help me. in powershell you are able to "pipe" the details of an object with get-member command and receive all properties and methods possible against that object. Does python have this capability?​

22nd Apr 2017, 11:55 AM
Shane Thompson
Shane Thompson - avatar
1 Resposta
+ 1
# you can use dir() on any object to get methods and properties, Is that what #you want ? class myObject: myClassProp = 'fred' def __init__(self): self.name = 'ric' self.age ='old' def mymethod(self): pass def myOtherMethod(self): pass anInstance = myObject() for item in dir(anInstance): print(item)
22nd Apr 2017, 12:42 PM
richard