Unbuffered mode

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hamish Allan

    Unbuffered mode

    Hi,

    The man page for python says:

    "-u Force stdin, stdout and stderr to be totally unbuffered."

    However, when I try:

    $ ssh localhost python -u
    print 'hello, world'
    [^D]
    hello, world
    $

    Nothing happens until I send that EOF. I'm pretty sure it's not SSH
    that's buffering because when I try:

    $ ssh localhost bash
    echo 'hello, world'
    hello, world
    [^D]
    $

    The 'hello, world' comes back immediately (I don't need to send the EOF).

    I've also tried:

    $ ssh localhost python -u
    import sys
    sys.stdout.writ e('hello, world\n')
    sys.stdout.flus h()
    [^D]
    hello, world
    $

    Again, nothing happens until I send the EOF. How can I get Python to
    run over SSH unbuffered?

    Thanks,
    Hamish
Working...