Re: Non-blocking raw_input

Discussion in 'Python' started by Jorge Louis de Castro, Jun 28, 2005.

  1. Thanks very much for you reply.

    I have indeed tried the msvcrt module but none of the examples given works
    as described on a XP+SP2 box.
    I have also looked at the twisted module but some functions there do not
    work on windows too, and I was told by one of the devs that it would stay
    that way for some time.

    Basically, I just want to wait for user input and echo it, though while the
    user is not typing anything I'd like to have a background thread printing
    "Come on, you're taking too long" or similar stuff.
    The problem is that I can only read (and in batch) the background thread
    printout messages on the console after feeding the raw_input function.

    I can't find any examples or useful directions on the documentation and I've
    spent a few days googling this to no avail.
    Is it not possible to have the thread print its stuff and then return to
    raw_input() ? Or use any function other than raw_input?

    Any code examples, pseudo-code, or documentation directions will be highly
    appreciated!

    Thanks in advance

    Cheers
    jorge

    >From: Peter Hansen <>
    >To:
    >Subject: Re: Non-blocking raw_input
    >Date: Mon, 27 Jun 2005 18:43:45 -0400
    >
    >Jorge Louis de Castro wrote:
    > > Could anyone tell me whether I can find a non blocking alternative to
    > > raw_input that works on windows? Is there not a python way of achieving
    > > this? Can I find it somewhere in the documentation?
    > > Any help will be highly appreciated

    >
    >Depending on what your requirements are (since you don't really say),
    >the functionality in the standard msvcrt module might help.
    >--
    >http://mail.python.org/mailman/listinfo/python-list
    Jorge Louis de Castro, Jun 28, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hendra Gunawan
    Replies:
    1
    Views:
    12,344
    Allan Herriman
    Apr 8, 2004
  2. Andre Kelmanson

    blocking i/o vs. non blocking i/o (performance)

    Andre Kelmanson, Oct 10, 2003, in forum: C Programming
    Replies:
    3
    Views:
    899
    Valentin Tihomirov
    Oct 12, 2003
  3. Jorge Louis de Castro

    Non-blocking raw_input

    Jorge Louis de Castro, Jun 27, 2005, in forum: Python
    Replies:
    3
    Views:
    693
    Dennis Lee Bieber
    Jun 28, 2005
  4. nukleus
    Replies:
    14
    Views:
    803
    Chris Uppal
    Jan 22, 2007
  5. Christian
    Replies:
    5
    Views:
    714
    Esmond Pitt
    Dec 2, 2007
Loading...

Share This Page