I have next python code:
exec_cmd = "time"
print exec_cmd
gzip_cmd = subprocess.Popen(exec_cmd, shell=True, stdout=subprocess.PIPE)
out = gzip_cmd.communicate()[0]
print out
When I try to execute this code I got next:
time
Usage: time [-apvV] [-f format] [-o file] [--append] [--verbose]
[--portability] [--format=format] [--output=file] [--version]
[--quiet] [--help] command [arg...]
But when I try to run this command in terminal I got:
time
real 0m0.000s
user 0m0.000s
sys 0m0.000s
So what is the problem?