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

Regards,
Stéphane

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to