Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to parse std out?
#1
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)
Reply
#2
Perhaps the entire process can be done from within python.
To do this, we need a complete spec for the process.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020