473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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

Dec 11 '06 #1
3 1992
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Xizor | last post by:
Lets say I got something simple like: <?php echo "yo"; echo "word"; ?> I want all those echos to write to a file instead of printing to the screen
1
by: Naeem Sarfraz | last post by:
I understand this file is under protection but how do I remove it from the 'detected dependencies' in the Installer project. The error message: 'shdocvw.dll' should be excluded because its...
2
by: Carramba | last post by:
hi! I'am wondering if I have program for ex int main(){ int Kod = 0; while(Kod >=0 && Kod <=126)
3
by: Paul Bowman | last post by:
Hi All Java has a facility where you can send output to a DOS window using System.out.println. This is useful while developing as you can see what it going in your code. Does .Net provide a...
13
by: Alexandra | last post by:
Hi, I have a hidden system file that I need to read. I am logged in as an administrator. I can not change the file attributes using the windows explorer.
1
by: Henk | last post by:
Hi, I have a problem with sending a file. I have a client application that connects to a server and sends the string "data". Then it sends a file. If the server receives "data", the method...
5
by: Lilith | last post by:
Would I be correct in assuming that the system file watcher is only valid for local drives and won't work for networked file system? -- Lilith
0
by: brianjharder | last post by:
I'm trying to download a text file to the client and all I can get it to do is open the file here is my code: public void getFile(string strFileName) { string strPath =...
2
by: minn | last post by:
Hi, Is it possible to save local system file path in php session; I explain that i want to achieve: A user selects image files from his computer in "A" web page , when a user goes to "B"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.