Help wanted in piping in Windows

Discussion in 'Python' started by Apple Grew, Jun 23, 2005.

  1. Apple Grew

    Apple Grew Guest

    I want to develope a Winboard like application which will support
    Winboard protocol. For that I require to know how to handle piping in
    Python. I seperated out module popen2, but when I use
    fileObject.readline() then it halts the program if the sub-process is
    waiting for user input; will executing the readline() part in a seperate
    thread be helpful? My target platform is Windows.

    Links to helpful web resources and sample Python codes will be highly
    appreciated.

    Regards,
    Apple
    Apple Grew, Jun 23, 2005
    #1
    1. Advertising

  2. Am Fri, 24 Jun 2005 01:28:38 +0530 schrieb Apple Grew:

    > I want to develope a Winboard like application which will support
    > Winboard protocol. For that I require to know how to handle piping in
    > Python. I seperated out module popen2, but when I use
    > fileObject.readline() then it halts the program if the sub-process is
    > waiting for user input; will executing the readline() part in a seperate
    > thread be helpful? My target platform is Windows.
    >
    > Links to helpful web resources and sample Python codes will be highly
    > appreciated.


    Piping on Windows is not much different than on Unix. You
    should only have *one* open file descriptor. If the subprocess
    needs to read from stdin, then stdout and stderr should be
    redirected to a file. Otherwise you can get deadlocks, because
    the buffers have a finit size.

    AFAIK ">file" and "2>file" does work on windows.

    On Unix you can the module "select".

    HTH,
    Thomas

    --
    Thomas G├╝ttler, http://www.thomas-guettler.de/
    Thomas Guettler, Jun 24, 2005
    #2
    1. Advertising

  3. Apple Grew

    Peter Hansen Guest

    Thomas Guettler wrote:
    > AFAIK ">file" and "2>file" does work on windows.


    Not, unfortunately (at least in the past), on Windows 98.

    That might no longer matter, however. How many people are still stuck
    using Windows 98? Given that in one year you won't even be able to get
    support from Microsoft's update site (such as if you have to reinstall),
    isn't it time to move on?

    to Linux...

    -Peter
    Peter Hansen, Jun 24, 2005
    #3
    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. Harvey
    Replies:
    0
    Views:
    692
    Harvey
    Jul 16, 2004
  2. Harvey
    Replies:
    1
    Views:
    834
    Daniel
    Jul 16, 2004
  3. Christian Long
    Replies:
    3
    Views:
    10,234
    Duncan Booth
    Jun 26, 2003
  4. virdo

    Help with a piping error

    virdo, Jun 10, 2011, in forum: Python
    Replies:
    4
    Views:
    4,052
    virdo
    Jun 10, 2011
  5. Mills Thomas (app1tam)

    Piping to windows command line .rb file doesn't work

    Mills Thomas (app1tam), Oct 14, 2003, in forum: Ruby
    Replies:
    1
    Views:
    118
Loading...

Share This Page