How to use sys.stdout and stdout.pipe in subprocess.run

General discussion for off-topic subjects.
Shanmugam
Junior Member
Posts: 2
Joined: Wed Oct 12, 2022 8:03 pm

How to use sys.stdout and stdout.pipe in subprocess.run

Postby Shanmugam » Thu Oct 13, 2022 7:17 pm

Hi,
I want to print the external commands and output both in real-time and in logs,
I am using the below

Code: Select all

p=subprocess.run("powershell.exe",c:\temp\hello.ps1",stdout=sp.PIPE,stderr =stdout)


I want to use sys.stdout along with sys.stdout to do in real-time,
Please advise

Thanks
Shanmugam

Return to “Whatever”

Who is online

Users browsing this forum: No registered users and 18 guests