Answer the question
In order to leave comments, you need to log in
How to get the output of the executed command?
subprocess.Popen([r'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'] + [r'Get-WMIObject -Class Win32_ComputerSystem -Computer "PC000329"|Select-Object Username'])
how to intercept the data that came to the console turned over.
Answer the question
In order to leave comments, you need to log in
from subprocess import check_output
out = check_output([r'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'] + [r'Get-WMIObject -Class Win32_ComputerSystem -Computer "PC000329"|Select-Object Username'])
Google for once
https://lexichdev.wordpress.com/2014/02/06/capturi...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question