我有下一个python代码:
exec_cmd = "time"
print exec_cmd
gzip_cmd = subprocess.Popen(exec_cmd, shell=True, stdout=subprocess.PIPE)
out = gzip_cmd.communicate()[0]
print out
Run Code Online (Sandbox Code Playgroud)
当我尝试执行此代码时,我接下来:
time
Usage: time [-apvV] [-f format] [-o file] [--append] [--verbose]
[--portability] [--format=format] [--output=file] [--version]
[--quiet] [--help] command [arg...]
Run Code Online (Sandbox Code Playgroud)
但是当我尝试在终端中运行此命令时,我得到了:
time
real 0m0.000s
user 0m0.000s
sys 0m0.000s
Run Code Online (Sandbox Code Playgroud)
那么问题是什么?