You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

13 lines
607 B

# -*- coding: utf-8 -*-
"""票 05:驱动 t05-test.cmd,捕获输出。"""
import io, sys, subprocess
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
r = subprocess.run(
['cmd', '/c', r'e:\code\crm-backend-matt\.scratch\opportunity-bugfix\t05-test.cmd'],
capture_output=True, cwd=r'e:\code\crm-backend-matt')
out = r.stdout.decode('utf-8', errors='replace') + r.stderr.decode('utf-8', errors='replace')
with open(r'e:\code\crm-backend-matt\.scratch\opportunity-bugfix\t05-test.log', 'w', encoding='utf-8') as f:
f.write(out)
print('EXIT=', r.returncode)
print(out[-2500:])