python on windos os.popen and standart in and out

  • Thread starter =?ISO-8859-15?Q?J=F6rg?= Maier
  • Start date
?

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

-----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-----
 
N

nneo

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")
 
?

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

-----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
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-----
 

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top