expect vs rubby vs python

ndemou at gmail.com ndemou at gmail.com
Wed Mar 12 13:51:54 EET 2008


On 3/12/08, costas <costas at freemail.gr> wrote:
>
> [...]
> Πριν όμως αρχίζω να πειραματίζομαι με μια ακόμη γλώσσα θα ήθελα
> να μάθω αν έχουν τη δυνατότητα να αλληλεπιδρούν με άλλα προγράμματα
> (πχ telnet ή ssh) όπως κάνει expect. Προφανώς αν δε μπορούν η όλη
> συζήτηση είναι άχρηστη.

για python υπάρχει το module pexpect το οποίο το έχω δουλέψει
επιτυχημένα και χωρίς κόπο ΣΕ ΕΝΑ ΑΠΛΟ προτζεκτάκι (ssh access σε ένα
linux box "κρυμένο" πίσω απο firewall που κόβει όλες τις εισερχόμενες
συνδέσεις).

http://www.noah.org/wiki/Pexpect#Description_of_Pexpect

  Description of Pexpect

Pexpect is a pure Python expect-like module. Pexpect makes Python a
better tool for controlling other applications.

Pexpect is a pure Python module for spawning child applications;
controlling them; and responding to expected patterns in their output.
Pexpect works like Don Libes' Expect. Pexpect allows your script to
spawn a child application and control it as if a human were typing
commands.

Pexpect can be used for automating interactive applications such as
ssh, ftp, passwd, telnet, etc. It can be used to a automate setup
scripts for duplicating software package installations on different
servers. It can be used for automated software testing. Pexpect is in
the spirit of Don Libes' Expect, but Pexpect is pure Python. Unlike
other Expect-like modules for Python, Pexpect does not require TCL or
Expect nor does it require C extensions to be compiled. It should work
on any platform that supports the standard Python pty module. The
Pexpect interface was designed to be easy to use.


More information about the Linux-greek-users mailing list