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

J

johnny

How do I pipe the output, generated from os.system(some_command), to
the logging file?
 
G

Gabriel Genellina

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
 
J

johnny

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)?
 
D

Dennis Lee Bieber

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)?
Use the help file, pick the "index" tab, and type "subprocess"; then
read the only entry that pops up...
Like os.popen(encode_cmd) , not os.system(encode_cmd)?
Concept is there... You'll have to have your thread /read/ the
output from the external process, and then feed that output to the
logging module.
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
G

Gabriel Genellina

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top