我在命令行中做了什么:
cat file1 file2 file3 > myfile
Run Code Online (Sandbox Code Playgroud)
我想用python做什么:
import subprocess, shlex
my_cmd = 'cat file1 file2 file3 > myfile'
args = shlex.split(my_cmd)
subprocess.call(args) # spits the output in the window i call my python program
Run Code Online (Sandbox Code Playgroud)