473,320 Members | 1,978 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,320 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 1846
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.