Reputation: 241
With the following code:
output = subprocess.check_output(['wmic', 'PATH', 'Win32_videocontroller', 'GET', 'description'])
print(output , "\n")
I get the next output:
b'Description \r\r\nNVIDIA GeForce 710M \r\r\nIntel(R) HD Graphics 4000 \r\r\n\r\r\n'
When I use the commando wmic path win32_videocontroller get desription
in my CMD I get only the videocard info back. Is this possible in python aswell? With out the /r/r/r/r things?
Upvotes: 1
Views: 426
Reputation: 224
Use the argument "universal_newlines=True" when you call the function:
output = subprocess.check_output(['wmic', 'PATH', 'Win32_videocontroller', 'GET', 'description'], universal_newlines=True)
print(output , "\n")
Upvotes: 2