472,363 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Help wanted in piping in Windows

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 helpful? My target platform is Windows.

Links to helpful web resources and sample Python codes will be highly
appreciated.

Regards,
Apple
Jul 19 '05 #1
2 1799
Am Fri, 24 Jun 2005 01:28:38 +0530 schrieb Apple Grew:
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 helpful? My target platform is Windows.

Links to helpful web resources and sample Python codes will be highly
appreciated.


Piping on Windows is not much different than on Unix. You
should only have *one* open file descriptor. If the subprocess
needs to read from stdin, then stdout and stderr should be
redirected to a file. Otherwise you can get deadlocks, because
the buffers have a finit size.

AFAIK ">file" and "2>file" does work on windows.

On Unix you can the module "select".

HTH,
Thomas

--
Thomas Güttler, http://www.thomas-guettler.de/
Jul 19 '05 #2
Thomas Guettler wrote:
AFAIK ">file" and "2>file" does work on windows.


Not, unfortunately (at least in the past), on Windows 98.

That might no longer matter, however. How many people are still stuck
using Windows 98? Given that in one year you won't even be able to get
support from Microsoft's update site (such as if you have to reinstall),
isn't it time to move on?

to Linux...

-Peter
Jul 19 '05 #3

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

Similar topics

4
by: Christian Long | last post by:
Hi I'm trying to pipe data into a python program on Windows 2000, on the command line. Like this: dir | myProgram.py Here's what I tried:
5
by: runes | last post by:
I trying to figure out a way to make a python script accept data output from another process under Windows XP, but I fail miserably. I have a vague memory having read this is not possible with...
6
by: mhenry1384 | last post by:
On WinXP, I am doing this nant.exe | python MyFilter.py This command always returns 0 (success) because MyFilter.py always succeeds. MyFilter.py looks like this while 1:
12
by: baumann | last post by:
hi all, printf("%c",b) doesn't work properly. #include <stdio.h> int a , b; char d, e; char * p; float f; int main(int argc, char* argv) {
3
by: James | last post by:
I'm interested in learning C++. I'm not sure exactly what this means. I'm currently a VB.NET/C#.NET programmer (both Windows Forms and ASP.NET). I am totally clueless when it comes to C++. I've...
3
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...
2
by: smitty1e | last post by:
The first print statement does what you'd expect. The second print statement has rather a lot of rat in it. The goal here is to write a function that will return the man page for some command...
4
by: samit | last post by:
I keen to persue coding like yahoo piping system which will include drag and drop and piping features
4
by: broli | last post by:
This appears on page number 20 of K & R 2 exercise number 1-10 Q. Write a program to copy its input to its output, replacing each tab by \t, each backspace by \b, and each backslash by \\. This...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...

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.