In article <[EMAIL PROTECTED]>,
 <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] a écrit :
>
>> 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.
>
>Try exec() and execfile() from the standard library (IIRC)
>
>>
>> for example. in my program I would want to call the ssh feature like
>> one does on the command line
>>
>> ssh [EMAIL PROTECTED]          .....etc
>>
>
>When you connect (via ssh or telnet) to a remote machine, you need to
>type (manually)
>your username and your password. Programming that is never easy.
>
>If what you need is simulating console interaction, you will need to
>get Expect.
>Expect allows you to program/emulate user interaction in a text
>console, based on the Tool Command Language (a.k.a. Tcl).
>
>But there are alternatives : start a SSH daemon written as a shell
>script. (you just have to enter your login/pass once, then call the
>daemon to execute some commands)
>
>IMHO, Expect is by far the cleanest way.
                        .
                        .
                        .
While Tcl-based Expect <URL: http://wiki.tcl.tk/expect > is
indeed a remarkable achievement, please be aware, as Avell
Diroll mentions elsewhere in this thread, that there is a
Python-based pexpect <URL: http://pexpect.sourceforge.net/ >
with all the basic functionality of its predecessor.  For
most programming requirements you're likely to encounter,
pexpect will serve you as well as Expect, and, of course, the
former is easier to use for Pythoneers.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to