473,776 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.read line() 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 1873
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.read line() 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
9922
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
2259
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 Python under Windows... But googling for a clue I came across this from /Learning Python/ (Lutz & Ascher) <Learning Python>
6
2420
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
2356
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
1750
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 tried creating new projects and even that is confusing. I'm unsure of the differences between MFC, ATL, Win32, etc. etc. applications. I don't even know where to begin. If I wanted to write a full screen application with some type of simple...
3
4245
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
2
1852
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 (mktemp used as a short example here) as text to client code, where the groff markup will be chopped to extract all of the command options. Those options will eventually be used within an emacs mode, all things going swimmingly. I don't know what's...
4
1321
by: samit | last post by:
I keen to persue coding like yahoo piping system which will include drag and drop and piping features
4
385
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 makes the tabs and backspaces visible in an unambiguous way. Here's my attempt : #include<stdio.h>
0
9464
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10122
jinu1996
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10061
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8954
agi2029
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7471
isladogs
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5368
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3627
muto222
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.