473,543 Members | 1,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

piping question

I have been working on a little frontend for newspost. It runs
newspost just fine and gets it's output. The problem is that i want it to
get the stdout as the program runs, not hold it all till it's
finished. I've tried a few variations of popen , and others with no luck.

Here is the subroutine that executes newspost:

def on_BT_go_clicke d(self,obj):
self.notebook.s et_current_page (3)
newspost = "newspost -i " + self.newsserver .get_text() + " "
newspost += "-z " + self.port.get_t ext() + " "
if self.username.g et_text() != "":
newspost += "-u " + self.username.g et_text() + " "
if self.password.g et_text() != "":
newspost += "-p " + self.password.g et_text() + " "
newspost += "-f " + self.email.get_ text() + " "
newspost += "-n " + self.newsgroup. get_text() + " "
newspost += "-s \"" + self.subject.ge t_text() + "\" "
if self.include_fi le_x_of_y.get_a ctive():
newspost += "-q "
if self.yenc.get_a ctive():
newspost += "-y "
for row in self.listmodel:
newspost += "\"" + row[0] + "\" "

pipe = os.popen(newspo st)
while 1:
output = pipe.read()
if not(output):
textiter = self.textbuffer .get_end_iter()
self.textbuffer .insert(textite r, output)

Apr 17 '06 #1
2 1120
Have you tried running python with '-u'? That turns off most buffering
within python at least. I'm not familiar with newspost, so I've no
idea what to do about any output buffering it might be doing.

Apr 17 '06 #2
In article <pa************ *************** @biggmatt.com>,
Biggmatt <ma**@biggmatt. com> wrote:
The problem is that i want it to
get the stdout as the program runs, not hold it all till it's

This has been discussed before. If the program you're trying to control
buffers its output and gives no option to disable that, then you're
stuck with the way it works.
Apr 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Csaba Henk | last post by:
For me, one reason for using Python is that with the help of it I can rid of several problems that I faced with during writing scripts in Bourneish shells. Biggest of these problem was the quotation madness stemming from the typelessness of the shell language. When using Python as a shell replacement I often launch apps from Python and use...
by: Apple Grew | last post by:
I want to develope a Winboard like application which will support Winboard protocol. For that I require to know how to handle piping in Python. I seperated out module popen2, but when I use fileObject.readline() then it halts the program if the sub-process is waiting for user input; will executing the readline() part in a seperate thread be...
by: christopher diggins | last post by:
I just wanted to share this technique for piping the cout from one function to the cin of another, using the pipe operator: #include <iostream> #include <sstream> using namespace std; typedef void(*procedure)();
by: Russ Schneider | last post by:
Is there an easy way to pipe a select statement's output to a file? -- http://www.sugapablo.com <--music ] http://www.sugapablo.net <--personal ] sugapablo@12jabber.com <--jabber IM ] ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives?
by: saibotorama | last post by:
What is the Python translation for this Bash statement: tar cf - "${files}" | bzip2 "$file".tar.bz2 (Ignoring the fact that "tar cjf" also exists...) In other words, how does one pipe together arbitrary commands?
by: moti | last post by:
I am a newbie to MySQL. I'm confused as to the piping syntax of SERVER in the User DSN in ODBC for a client PC. If I use an ip it does not work, probably because of a firewall. So I tried using named pipes and nothing seems to work. I am running MySQL on a windows xp and all the client PCs are on xp too. Named Pipes is checked as well as...
by: noob2008 | last post by:
can anyone explain me what is piping in C++ programming? for example invoice.exe < purchase.dat > statement.txt do i replace that where all the cin statements? i created a text file called purchase.dat with values: gameboy 149.99 1 ipod nano 220.99 2 DVD-player5 60.95 1
by: AtoZ | last post by:
Hello, I'm looking for some experience translation between the software PDMS to Pro/ENGINEER ( Pro/PIPING ) and reverse. If some engineer know the solutions, their feedback will be very usefull ! Thank You Antony AtoZ
by: samit | last post by:
I keen to persue coding like yahoo piping system which will include drag and drop and piping features
by: jsimps44 | last post by:
Hi, I'm fairly new to c, and very new to piping and file descriptors and can't seem to get past this problem. The piping is very much not working, and I can't figure out for the life of me why. Any help at all would be greatly appreciated. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h>...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.