Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Can Python replace TCL/Expect

Reply
Thread Tools

Can Python replace TCL/Expect

 
 
xinchenvn@gmail.com
Guest
Posts: n/a
 
      10-06-2005
Hi

I'm learning Python. I don't know whether Python can do something like
Expect can do. If yes, please show me how to do it.
I want to do something automatically: open connection to a ftp server,
get the welcome message on the screen (not in the packet). I can do it
easily with Expect but I still don't have any idea with Python.
If possible, can you introduce me some book or website that I can get
infor about automation programming with Python

Thanks

 
Reply With Quote
 
 
 
 
Robert Kern
Guest
Posts: n/a
 
      10-06-2005
wrote:
> Hi
>
> I'm learning Python. I don't know whether Python can do something like
> Expect can do. If yes, please show me how to do it.
> I want to do something automatically: open connection to a ftp server,
> get the welcome message on the screen (not in the packet). I can do it
> easily with Expect but I still don't have any idea with Python.
> If possible, can you introduce me some book or website that I can get
> infor about automation programming with Python


You'll probably want to take a look at pexpect:

http://pexpect.sourceforge.net/

--
Robert Kern


"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

 
Reply With Quote
 
 
 
 
Cameron Laird
Guest
Posts: n/a
 
      10-06-2005
In article <mailman.1583.1128579857.509.python->,
Robert Kern <> wrote:
> wrote:
>> Hi
>>
>> I'm learning Python. I don't know whether Python can do something like
>> Expect can do. If yes, please show me how to do it.
>> I want to do something automatically: open connection to a ftp server,
>> get the welcome message on the screen (not in the packet). I can do it
>> easily with Expect but I still don't have any idea with Python.
>> If possible, can you introduce me some book or website that I can get
>> infor about automation programming with Python

>
>You'll probably want to take a look at pexpect:
>
> http://pexpect.sourceforge.net/

.
.
.
1. Yes.
2. While Pexpect indeed "can do something like Expect",
it does NOT have all the facilities and polish of the
latter.
3. But very, VERY few of Expect's users are aware of more
than a handful of Expect's functions, let alone use them,
so it's fair to say that Pexpect does everything Expect
does, within the realm of ordinary use.
4. But it sort-of doesn't matter anyway, because, if the
goal is (as appears in this case) to work with ftp,
there are better ways to work, anyway <URL:
http://phaseit.net/claird/comp.unix....utomation.html >
<URL: http://www.python.org/doc/current/li...r-objects.html >.
 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      10-06-2005
On Thu, 06 Oct 2005 11:08:09 GMT, Cameron Laird <> wrote:
> In article <mailman.1583.1128579857.509.python->,
> Robert Kern <> wrote:
>> wrote:
>>> Hi
>>>
>>> I'm learning Python. I don't know whether Python can do something like
>>> Expect can do. If yes, please show me how to do it.

....
> 2. While Pexpect indeed "can do something like Expect",
> it does NOT have all the facilities and polish of the
> latter.
> 3. But very, VERY few of Expect's users are aware of more
> than a handful of Expect's functions, let alone use them,
> so it's fair to say that Pexpect does everything Expect
> does, within the realm of ordinary use.


It depends. I do not feel /that/ advanced, but I've been bitten by pexpect's
limitations several times in several places.

.... which puts me in a weird position I /loathe/ the Tcl language, but I
have to admit that its expect functionality is far superior to Python's.

/Jorgen

--
// Jorgen Grahn <jgrahn@ Ph'nglui mglw'nafh Cthulhu
\X/ algonet.se> R'lyeh wgah'nagl fhtagn!
 
Reply With Quote
 
Cameron Laird
Guest
Posts: n/a
 
      10-06-2005
In article <slrndkae7r.2ss.jgrahn->,
Jorgen Grahn <jgrahn-> wrote:
.
.
.
>It depends. I do not feel /that/ advanced, but I've been bitten by pexpect's
>limitations several times in several places.
>
>... which puts me in a weird position I /loathe/ the Tcl language, but I
>have to admit that its expect functionality is far superior to Python's.

.
.
.
'Salright. There are Tcl programmers who feel the same way,
for example, about Python and its object orientation.

On to more constructive matters: what are you doing about
Pexpect's limitations? Have the maintainers responded to you
when you write? Are you tempted to compose enhancements for
yourself?
 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      10-07-2005
On Thu, 06 Oct 2005 17:08:03 GMT, Cameron Laird <> wrote:
> In article <slrndkae7r.2ss.jgrahn->,
> Jorgen Grahn <jgrahn-> wrote:
> .
> .
> .
>>It depends. I do not feel /that/ advanced, but I've been bitten by pexpect's
>>limitations several times in several places.
>>
>>... which puts me in a weird position I /loathe/ the Tcl language, but I
>>have to admit that its expect functionality is far superior to Python's.

> .
> .
> .


> On to more constructive matters: what are you doing about
> Pexpect's limitations? Have the maintainers responded to you
> when you write? Are you tempted to compose enhancements for
> yourself?


There is hobby hacking, and there is work. I've encountered pexpect during
work, and haven't had the time and energy to look into it. I hereby
apologize to the pexpect developers. Not for whining, but for not helping
out.

/Jorgen

--
// Jorgen Grahn <jgrahn@ Ph'nglui mglw'nafh Cthulhu
\X/ algonet.se> R'lyeh wgah'nagl fhtagn!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace /n with a XHTML <br /> using string.replace Alun ASP .Net 3 02-18-2008 05:52 AM
Re: [Pyrex] pyrex functions to replace a method (Re: replace a method Greg Ewing Python 2 06-29-2006 05:25 PM
pyrex functions to replace a method (Re: replace a method in class:how?) Brian Blais Python 1 06-27-2006 12:13 PM
s/$match/$replace/ fails when $replace has backreferences anonyusenet@yahoo.com Perl Misc 3 09-12-2005 11:03 AM
help with string replace - for doing selective replace Prasad S Javascript 2 08-27-2004 03:22 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57