From: Julian Schaefer-J. <jul...@t-...> - 2002-07-11 18:49:14
|
As previously pointed out, pyssh seems to have some difficulties. It works perfectly and the command should be executed (one may check that), but the output can' t be fetched due to some inconsistancy. It seems to be important to read every output (eg also the entered login). I have neither had the time nor the passion :) - to provide pyssh with a patch for that, since even the developer himself doesn' t use it. :) Attached to this mail you find some code which should work in place of pyssh. It is something I recently did for a project at university. I grabed the files from a package (another context) - so names may look a bit confusing - but it should work. You' re free to use it in any way you want. python pyssh.py host=3Dtycho.lpthe.jussieu.fr user=3Dmicheles = command=3Ddate password=3D******* debug=3D1=20 >> child says: "mic...@ty...'s password: "=20 >> child took 8 password bytes=20 >> sleeping 0 secs=20 >> child took 5 command bytes=20 >> child response is '\r\ndate\r\n'=20 results =3D=20 '\r\ndate\r\n'=20 I would expect a string with the date instead !=20 Any suggestion ?=20 Second question: how can I scp a file ??=20 thanks,=20 --=A0 Michele Simionato - Dept. of Physics and Astronomy 210 Allen Hall Pittsburgh PA 15260 U.S.A. Phone: 001-412-624-9041 Fax: 001-412-624-9163 Home-page: http://www.phyast.pitt.edu/~micheles/ =A0 Cheers, Julian ______________________________________________________________ Julian Schaefer-Jasinski mailto:jas...@cs... Frankfurt, Germany http://wgfalk.dyndns.org/ "A great many people think they are thinking when they are merely rearranging their prejudices." - William James |