By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,251 Members | 2,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,251 IT Pros & Developers. It's quick & easy.

newb: SENDING os.system(encode_cmd) output to a logging file

P: n/a
How do I pipe the output, generated from os.system(some_command), to
the logging file?

Dec 11 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
At Monday 11/12/2006 20:47, johnny wrote:
>How do I pipe the output, generated from os.system(some_command), to
the logging file?
Use the subprocess module to run the command instead.
--
Gabriel Genellina
Softlab SRL

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ˇgratis!
ˇAbrí tu cuenta ya! - http://correo.yahoo.com.ar
Dec 12 '06 #2

P: n/a
I am doing the os.system(encode_cmd) within a thread. So you are
saying, have each thread create a subprocess module. Did you mean,
"Popen" (os.popen)?

Like os.popen(encode_cmd) , not os.system(encode_cmd)?

Gabriel Genellina wrote:
At Monday 11/12/2006 20:47, johnny wrote:
How do I pipe the output, generated from os.system(some_command), to
the logging file?

Use the subprocess module to run the command instead.
--
Gabriel Genellina
Softlab SRL

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ˇgratis!
ˇAbrí tu cuenta ya! - http://correo.yahoo.com.ar
Dec 12 '06 #3

P: n/a
At Monday 11/12/2006 23:49, johnny wrote:
>Gabriel Genellina wrote:
At Monday 11/12/2006 20:47, johnny wrote:
>How do I pipe the output, generated from os.system(some_command), to
>the logging file?
Use the subprocess module to run the command instead.

I am doing the os.system(encode_cmd) within a thread. So you are
saying, have each thread create a subprocess module. Did you mean,
"Popen" (os.popen)?

Like os.popen(encode_cmd) , not os.system(encode_cmd)?
No, I mean the module called "subprocess" contained in the standard
Python library since version 2.4:
http://docs.python.org/lib/module-subprocess.html
--
Gabriel Genellina
Softlab SRL

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ˇgratis!
ˇAbrí tu cuenta ya! - http://correo.yahoo.com.ar
Dec 12 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.