Timeline for Python redirection in subprocess.Popen
Current License: CC BY-SA 3.0
Post Revisions
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 20, 2020 at 9:12 | history | edited | Community Bot |
Commonmark migration
|
|
| S Jun 12, 2016 at 13:10 | history | edited | armatita | CC BY-SA 3.0 |
correct spelling; Quoted exception;
|
| S Jun 12, 2016 at 13:10 | history | suggested | muetzerich | CC BY-SA 3.0 |
correct spelling
|
| Jun 12, 2016 at 12:23 | review | Suggested edits | |||
| S Jun 12, 2016 at 13:10 | |||||
| May 24, 2016 at 16:09 | comment | added | kaligne |
@Corley Brigman: I changed from the subprocess.call() to subprocess.Popen() to track the exit status when piping
|
|
| May 24, 2016 at 16:08 | comment | added | kaligne | @Robφ: I actually used this chunk in a function, I used the str() to make sure the argument was a string. But here in my example it is totally irrelevant you are right | |
| May 24, 2016 at 16:05 | vote | accept | kaligne | ||
| May 24, 2016 at 15:51 | comment | added | Robᵩ |
Aside: why do you call str(cmd2).split() rather than cmd2.split()? Since cmd2 is already a str what does the extra function call get?
|
|
| May 24, 2016 at 15:48 | answer | added | Robφ | timeline score: 3 | |
| May 24, 2016 at 15:46 | comment | added | Corley Brigman |
see docs.python.org/2/library/…. alternately, you may want to try using shell=True, which should actually start bash instead of the exact commands, and let you put the entire line (with pipes, redirects, and all - which are shell functions anyways, not part of the called executables) as is....
|
|
| May 24, 2016 at 15:45 | comment | added | syntonym |
If you hardcode the command as a list (instead of doing format and then split) does it work? I think split splits your filter apart into ["--filter='gzip", ">", "$FILE.gz'"] which is not what you want.
|
|
| May 24, 2016 at 15:38 | history | asked | kaligne | CC BY-SA 3.0 |