reading one byte from stdin

Discussion in 'Python' started by Mark McDuff, Jul 16, 2008.

  1. Mark McDuff

    Mark McDuff Guest

    I'm trying to read one byte from stdin, without the newline.

    If I try something like:
    I can input a character, but then I have to press enter, which leaves
    a newline character in the stdin buffer and requires two keypresses.
    Is there any way to read only one keypress in a simple manner (i.e. no
    Mark McDuff, Jul 16, 2008
    1. Advertisements

  2. Depending on your OS, yes. Under *nix, you need to set the terminal to

    This recipe claims to be OS-agnostinc:

    Diez B. Roggisch, Jul 16, 2008
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.