Desktop\test.ps1:
write-output 'test'
test.py:
# -*- coding: iso-8859-1 -*-
import subprocess, sys
p = subprocess.Popen(["powershell.exe",
"C:\\Users\\<USER>\\Desktop\\test.ps1"],
stdout=sys.stdout)
p.communicate()
python test.py
test
for /f "tokens=xxx delims=yyy" %%a in ('тут нужная команда') do (
echo %%a
)
for /?
program > file
program > file 2>&1
program | program2
program | program2 2>&1