|
|
|
|
|
|
| Author |
Message |
ciccio@unical.it *nix forums beginner
Joined: 07 Jun 2006
Posts: 5
|
Posted: Wed Jul 19, 2006 3:48 pm Post subject:
capture the output
|
|
|
Dear all,
I'm executing a program by os.spawnv() function. However the program print out
several things. I would to capture this output, but I don't know how.
Could you give me a suggestion?
Thank you
Ernesto
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/ |
|
| Back to top |
|
 |
ciccio@unical.it *nix forums beginner
Joined: 07 Jun 2006
Posts: 5
|
Posted: Wed Jul 19, 2006 4:18 pm Post subject:
Re: capture the output
|
|
|
On 7/19/06, ciccio@unical.it <ciccio@unical.it> wrote:
Dear all,
I'm executing a program by os.spawnv() function. However the program print out
several things. I would to capture this output, but I don't know how.
Could you give me a suggestion?
Thank you
Ernesto
Hi Ernesto
could you use popen2 or are you bound to os.spawnv?
- Unfortunately I cannot use functions calling the cmd.exe. My operating system
is windows
from os import popen2
dummy, stdout = popen2("prog")
stdout.readlines
and why not put this into a thread?
- Because I don't know how...
Ciao
Roberto
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
--
http://mail.python.org/mailman/listinfo/python-list
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/ |
|
| Back to top |
|
 |
ciccio@unical.it *nix forums beginner
Joined: 07 Jun 2006
Posts: 5
|
Posted: Fri Jul 21, 2006 7:20 am Post subject:
Re: capture the output
|
|
|
On 7/19/06, ciccio@unical.it <ciccio@unical.it> wrote:
On 7/19/06, ciccio@unical.it <ciccio@unical.it> wrote:
Dear all,
I'm executing a program by os.spawnv() function. However the program print out
several things. I would to capture this output, but I don't know how.
Could you give me a suggestion?
Thank you
Ernesto
Hi Ernesto
could you use popen2 or are you bound to os.spawnv?
- Unfortunately I cannot use functions calling the cmd.exe. My operating system
is windows
Hmm can you elaborate on this, it works perfectly on my XP.
- In reality It works also on my XP, but my application is a web application
and thus I have not all permissions and in particular the permission to run cmd.exe.
from os import popen2
dummy, stdout = popen2("prog")
stdout.readlines
and why not put this into a thread?
- Because I don't know how...
That was just an idea, does not matter for now.
Ciao
Roberto
Anyway thank you
Ernesto
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
--
http://mail.python.org/mailman/listinfo/python-list
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
--
http://mail.python.org/mailman/listinfo/python-list
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/ |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sun Nov 23, 2008 1:22 pm | All times are GMT
|
|
Bay Area Web Design | Payday Loan | Loans | Car Loans | Free Ringtones
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|