H
hg
Hi,
Is there a way ? ... select ?
hg
Is there a way ? ... select ?
hg
PS:hg said:Hi,
Is there a way ? ... select ?
hg
Laurent said:hg a écrit :PS:hg said:Hi,
Is there a way ? ... select ?
hg
import sys
import select
l_r = select.select([sys.stdin],[],[],0)
gives me:
File "select.py", line 2, in ?
import select
File "/home/philippe/Desktop/select.py", line 4, in ?
l_r = select.select([sys.stdin],[],[],0)
TypeError: 'module' object is not callable
Wont work under Windows:...<zip>...
*** IMPORTANT NOTICE ***
On Windows, only sockets are supported; on Unix, all file descriptors.
If under Unix, maybe sys.stdin.fileno() is a valid descriptor for
select. Just test it.
And if under Windows, you may take a look at
22.1 msvcrt - Useful routines from the MS VC++ runtime
22.1.2 Console I/O
kbhit( ) - Return true if a keypress is waiting to be read.
Paul said:hg said:import select
[...]
File "/home/philippe/Desktop/select.py", line 4, in ?
Consider which module Python is trying to import here: the standard
library select module or your own program?
Paul
Gabriel said:I think you may want this portable getch function:
<http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/134892>
--
Gabriel Genellina
Softlab SRL
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
PS:hg said:Hi,
Is there a way ? ... select ?
hg
import sys
import select
l_r = select.select([sys.stdin],[],[],0)
gives me:
File "select.py", line 2, in ?
import select
File "/home/philippe/Desktop/select.py", line 4, in ?
l_r = select.select([sys.stdin],[],[],0)
TypeError: 'module' object is not callable
hg said:import select
[...]
File "/home/philippe/Desktop/select.py", line 4, in ?
Well I'm testing under Linux but need support under Windows ... is there any
way to poll stdin somehow under both plateform ?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.