473,473 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

select.select() on windows

jas
I am currently using subprocess to execute a command. Then I read from
it's stdout...however, this is hanging on a read..waiting for more
bytes. So what I would like is to timeout...and select.selec() seems
to be what I need. Except I don't have a socket, i have stdout.

Any suggestions on how to do a timeout like select.select with stdout?

Thanks

Oct 25 '05 #1
4 5646

you have to use non-block readining.

http://docs.python.org/lib/module-select.html:
A time-out value of zero specifies a poll and never blocks.

jas wrote:
I am currently using subprocess to execute a command. Then I read from
it's stdout...however, this is hanging on a read..waiting for more
bytes. So what I would like is to timeout...and select.selec() seems
to be what I need. Except I don't have a socket, i have stdout.

Any suggestions on how to do a timeout like select.select with stdout?

Thanks

--
Best regards,
Maksim Kasimov
mailto: ma************@gmail.com
Oct 26 '05 #2

jas wrote:
I am currently using subprocess to execute a command. Then I read from
it's stdout...however, this is hanging on a read..waiting for more
bytes. So what I would like is to timeout...and select.selec() seems
to be what I need. Except I don't have a socket, i have stdout.

Any suggestions on how to do a timeout like select.select with stdout?


I am not too familiar with any asynchronous I/O facilities in Python
beyond select, so in your situation I would use the threading module,
with the blocking read in one thread and your time-out in the main
thread. You could perhaps use an Event object here, which has the
time-out functionality for you.

--
Ben Sizer

Oct 26 '05 #3
On Wed, 26 Oct 2005 11:29:17 +0300, Maksim Kasimov
<ma************@gmail.com> declaimed the following in comp.lang.python:

you have to use non-block readining.

http://docs.python.org/lib/module-select.html:
A time-out value of zero specifies a poll and never blocks.
Did you miss the subject line... "... on windows"? select() only
works with sockets on windows, not on regular file streams.
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Oct 26 '05 #4

yes, i missed, sorry

Dennis Lee Bieber wrote:
On Wed, 26 Oct 2005 11:29:17 +0300, Maksim Kasimov
<ma************@gmail.com> declaimed the following in comp.lang.python:

you have to use non-block readining.

http://docs.python.org/lib/module-select.html:
A time-out value of zero specifies a poll and never blocks.


Did you miss the subject line... "... on windows"? select() only
works with sockets on windows, not on regular file streams.

--
Best regards,
Maksim Kasimov
mailto: ma************@gmail.com
Oct 27 '05 #5

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

Similar topics

4
by: Jonathan Fine | last post by:
Hello I have written a program that interacts with a command line program. Roughly speaking, it mimics human interaction. (With more speed and accuracy, less intelligence.) It works fine...
2
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
2
by: Vagabond Software | last post by:
I'm at a complete loss on this problem. I'm using a DataColumn Expression with the DataTable Select method to return rows matching a data. Rows are returned on my Windows XP Professional computer...
0
by: Vagabond Software | last post by:
I posted this problem earlier and now have more information. I use the DataTable Select method to get find the most recent "LastModified" date in a table of similarly named files. I then use the...
4
by: Lastie | last post by:
Hi all, I’m an ASP developer but I just started to try and learn ASP.NET. I have the following code but it seems like I have a permissions problem. <%@ Page Language="VB" Debug="true" %>...
5
by: Martin Bischoff | last post by:
Hi, is it possible to modify the values of a SqlDataSource's select parameters in the code behind before the select command is executed? Example: I have an SqlDataSource with a...
5
by: hexathioorthooxalate | last post by:
All, I appear to have a mind block at the moment. Could someone help me out and get me over this hurdle. 1. Create a new VB.Net 2003 project with form1 open. 2. Drop a "button1" onto the form....
6
by: Jack | last post by:
I have the following: * An OLEDBCommand with command text "SELECT CAMPAIGN, DAY_OUT WHERE (CAMPAIGN LIKE '@campaign')" * A DataAdapter that point the select to the above command * A data grid...
5
by: carrajo | last post by:
Hey, I'm trying to duplicate the following: Select List 1 --- Apple Orange Banana
1
by: John Pote | last post by:
Hi all, I have the standard Python 2.4.4 windows download installed on my win XP box. But the poll class in module select is not available. The docs indicate that it can work with windows as...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
tracyyun
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...
0
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,...
1
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...
0
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 ...
0
muto222
php
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.