problem with async chat client in windows

J

Jonas

Hi,
I'm writing a small chat client to learn some python and networking. No problem
with the network stuff tho, the problem is when the user should be able to
interact and type messages to send. Since I work with windows I can't use the
select function (http://www.python.org/doc/current/lib/module-select.html).
Maybe it could work if I use two threads? One thread reading keyboard and the
other handling network stuff, but I would prefer to leave threads out from this.
Any suggestions?

thx for your time
 
J

Jp Calderone

Hi,
I'm writing a small chat client to learn some python and networking. No
problem with the network stuff tho, the problem is when the user should be
able to interact and type messages to send. Since I work with windows I
can't use the select function

Why not? select works perfectly well on Windows.

See http://www.twistedmatrix.com/

Jp
 
J

Jonas

Jp said:
Why not? select works perfectly well on Windows.

See http://www.twistedmatrix.com/

Jp

Well the standard library select doesn't work for file descriptors like stdin on
windows and I didn't know about Twisted. Anyway there must be some way to solve
this without the need for extra depencencies??
 
J

Jp Calderone

Well the standard library select doesn't work for file descriptors like
stdin on windows and I didn't know about Twisted. Anyway there must be some
way to solve this without the need for extra depencencies??

Ahh! I did not jump from "type messages to send" to "select on stdin",
just assumed you were popping up a window into which the user could type.

Twisted won't help with reading from stdin, as it relies on select()
working on that file descriptor.

Not sure if one of the win32-specific modules has something useful here.
I'd probably just use a GUI.

Sorry,

Jp
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top