python on windos os.popen and standart in and out

Discussion in 'Python' started by =?ISO-8859-15?Q?J=F6rg?= Maier, Jul 27, 2003.

  1. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Hy,
    i want remote ls via shh from a windows machine. after starting the command
    via
    # stdoutssh = os.popen('/path/to/ssh.exe user@host ls -al ~' -+' 2>&1', 'r')
    i have the possibility to watch the standart output in the pipe, but i cant
    give the password. when giving 'w' as second parameter, i just can write,
    but not read. ssh is installed by cygwin. i dont want to use ssh-keys,
    because user shold be able to use the program on different machines without
    much key-copying.

    thank you for every advice.
    regards,
    joerg
    - --
    Hi
    I am a signature virus.
    Please copy me to your .signature file to help me spread.
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

    iD8DBQE/JEoOTYj8eXbs1acRAt6VAJ9YIDo6Busujj3TAun34t7kXG0VaQCfa4Bv
    /I9/X+GUl3QjNw+xN2vOigY=
    =qE1P
    -----END PGP SIGNATURE-----
    =?ISO-8859-15?Q?J=F6rg?= Maier, Jul 27, 2003
    #1
    1. Advertising

  2. =?ISO-8859-15?Q?J=F6rg?= Maier

    nneo Guest

    On Sun, 27 Jul 2003 23:54:18 +0200, Jörg Maier wrote:

    > when giving 'w' as second parameter, i just can write,
    > but not read. ssh is installed by cygwin. i dont want to use ssh-keys,
    > because user shold be able to use the program on different machines
    > without much key-copying.


    Instead of os.popen try os.popen2 which gives
    back 2 pipes , one to read and onother to write to you application .

    p1 , p2 = os.popen2("foo")
    nneo, Jul 28, 2003
    #2
    1. Advertising

  3. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    thanks,
    i am so stupid, thats the right stuff, just read the moules documentation
    and there was something like
    <from the popen2 module; these are only available on Unix.>
    But down there they say
    <Availability: Unix, Windows.>

    thats what i need now

    bye joerg

    nneo wrote:

    > On Sun, 27 Jul 2003 23:54:18 +0200, Jörg Maier wrote:
    >
    >> when giving 'w' as second parameter, i just can write,
    >> but not read. ssh is installed by cygwin. i dont want to use ssh-keys,
    >> because user shold be able to use the program on different machines
    >> without much key-copying.

    >
    > Instead of os.popen try os.popen2 which gives
    > back 2 pipes , one to read and onother to write to you application .
    >
    > p1 , p2 = os.popen2("foo")


    - --
    Hi
    I am a signature virus.
    Please copy me to your .signature file to help me spread.
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

    iD8DBQE/JbbNTYj8eXbs1acRArKcAKCeb5qP4Psd8VFA+KlZh1FVAweLOgCgyYiZ
    7M1g4m+q5J8cWOXF8PVxHHs=
    =z7vi
    -----END PGP SIGNATURE-----
    =?ISO-8859-15?Q?J=F6rg?= Maier, Jul 29, 2003
    #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. Michael Shestero
    Replies:
    1
    Views:
    462
    Ron Natalie
    Dec 22, 2003
  2. heinquoi
    Replies:
    10
    Views:
    601
    Leor Zolman
    May 11, 2004
  3. gslm
    Replies:
    4
    Views:
    278
  4. Steve Holden
    Replies:
    0
    Views:
    487
    Steve Holden
    Feb 26, 2009
  5. Knut Krueger
    Replies:
    11
    Views:
    870
    Jeff Thies
    May 3, 2011
Loading...

Share This Page