Search found 2 matches

by Shanmugam
Thu Oct 13, 2022 7:17 pm
Forum: Whatever
Topic: How to use sys.stdout and stdout.pipe in subprocess.run
Replies: 0
Views: 29831

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

Hi, I want to print the external commands and output both in real-time and in logs, I am using the below 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
by Shanmugam
Wed Oct 12, 2022 8:10 pm
Forum: Whatever
Topic: How to use subprocess to print both in real-time and to log
Replies: 1
Views: 20062

How to use subprocess to print both in real-time and to log

Hi support,
Need your help.
I am trying to call a Powershell script from python, what subprocess i need to use to get it printed both in real-time and log files.
If anyone have a sample file it would help.


Thanks
Shanmugam

Go to advanced search