473,434 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

python on windos os.popen and standart in and out

-----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/JEoOTYj8eXbs1acRAt6VAJ9YIDo6Busujj3TAun34t7kXG0VaQ Cfa4Bv
/I9/X+GUl3QjNw+xN2vOigY=
=qE1P
-----END PGP SIGNATURE-----
Jul 18 '05 #1
2 3557
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")
Jul 18 '05 #2
-----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+KlZh1FVAweLOg CgyYiZ
7M1g4m+q5J8cWOXF8PVxHHs=
=z7vi
-----END PGP SIGNATURE-----
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Robin Siebler | last post by:
I have a bunch of command line tests that I need to automate. I've run into too many bugs with the default Win2k command shell, so I need to either purchase 4NT or handle the logic and output...
22
by: Alexander Schmolck | last post by:
Two smallish things that have been bugging me; I'm not sure whether they're actually broken or not, but anyway here it goes: 1. ``os.system`` (and co): Shouldn't ``os.system``'s signature really...
2
by: Xah Lee | last post by:
Python Doc Problem Example: os.system Xah Lee, 2005-09 today i'm trying to use Python to call shell commands. e.g. in Perl something like output=qx(ls) in Python i quickly located the...
16
by: diffuser78 | last post by:
I want to write a python program and call OS specific commands in it. So basically, instead of typing in on the command line argument I want to have it in a python program and let it do the action....
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 413 open ( +1) / 3407 closed (+10) / 3820 total (+11) Bugs : 897 open ( -3) / 6167 closed (+18) / 7064 total (+15) RFE : 234 open...
7
by: Jonathan Fine | last post by:
Hello My problem is that I want a Python 2.4 module on a server that is running Python 2.3. I definitely want to use the 2.4 module, and I don't want to require the server to move to Python...
24
by: Joe Salmeri | last post by:
I just upgraded from Python 2.4.2 to Python 2.5.1 and have found some unexpected behavior that appears to be a bug in the os.stat module. My OS is Windows XP SP2 + all updates. I have several...
4
by: Aidan | last post by:
Hi, I'm having a bit of trouble with a python script I wrote, though I'm not sure if it's related directly to python, or one of the other software packages... The situation is that I'm trying...
10
by: bruce | last post by:
hi... can someone point me to where/how i would go about calling a ruby app from a python app, and having the python app being able to get a returned value from the ruby script. something...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.