Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
output from popen
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Kushal Kumaran, post: 4053745"] First, the output of "time" is not actually garbage. It probably has all the information you need. Second, when you run "time" from the terminal, you are probably invoking the version of "time" built in to your shell. You can try explicitly running /usr/bin/time (probably, could be /bin/time or something else) to get the output you're seeing from your program. Passing shell=True to subprocess.Popen invokes a shell to run your command. You will also need to pass executable="path-to-your-shell" for exact results. That should give you the same output as you get from a terminal. You will probably need to change the "cmd" arg to be a string. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
output from popen
Top