niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » python
capture the output
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
ciccio@unical.it
*nix forums beginner


Joined: 07 Jun 2006
Posts: 5

PostPosted: Wed Jul 19, 2006 3:48 pm    Post subject: capture the output Reply with quote

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

PostPosted: Wed Jul 19, 2006 4:18 pm    Post subject: Re: capture the output Reply with quote

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

PostPosted: Fri Jul 21, 2006 7:20 am    Post subject: Re: capture the output Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Sun Nov 23, 2008 1:22 pm | All times are GMT
navigation Forum index » Programming » python
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts mailq output format bacilko1 Postfix 0 Tue Oct 03, 2006 12:34 pm
No new posts syslog Output Change Maja AIX 0 Thu Jul 20, 2006 8:41 pm
No new posts output number mm.omid@gmail.com C++ 1 Thu Jul 20, 2006 5:09 pm
No new posts Please suggest a video capture software thisissantanu@gmail.com Debian 2 Wed Jul 19, 2006 11:10 am
No new posts Logging console output to external server tomec@obywatel.pl security 4 Tue Jul 18, 2006 5:34 pm

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
[ Time: 0.2266s ][ Queries: 16 (0.1485s) ][ GZIP on - Debug on ]