Python Forum

Full Version: How to parse std out?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to parse the output below. I want to get IP Address line.

__GENUS          : 2
__CLASS          : Win32_NetworkAdapterConfiguration
__SUPERCLASS     : 
__DYNASTY        : 
__RELPATH        : 
__PROPERTY_COUNT : 1
__DERIVATION     : {}
__SERVER         : 
__NAMESPACE      : 
__PATH           : 
IPAddress        : {192.168.1.16, fe80::801:8181:f074:bcda}
PSComputerName   : 
I tried this code but it doesnt give me any result.


print(result.std_out)
for line in result.std_out:
    if "IPAddress" in line:
        print(line)
Perhaps the entire process can be done from within python.
To do this, we need a complete spec for the process.