471,353 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,353 software developers and data experts.

Python & Expect

Is there an Expect-like module for Python that is cross platform and, for the most part, does what
Expect does? A number of years ago, I wrote some Tcl scripts using Expect for automation. I am
trying to convince my good friend who I worked with at the time to try Python. He said, "what about
Expect?"

I have heard of a Pexpect but was told that it didn't run on win32 and he needs win32 and Linux
support both.

Thanks,
Jeff
Jul 18 '05 #1
9 2981
Jeff Wagner wrote:

Is there an Expect-like module for Python that is cross platform and, for the most part, does what
Expect does? A number of years ago, I wrote some Tcl scripts using Expect for automation. I am
trying to convince my good friend who I worked with at the time to try Python. He said, "what about
Expect?"

I have heard of a Pexpect but was told that it didn't run on win32 and he needs win32 and Linux
support both.


Hmmm... let's see what Google brings up... (typing)

http://www.google.com/search?q=python+expect

Wow! Look at that! Pexpect is the first hit. Let's try accessing that
page and see what it says. (click) Ah, there's a "Requirements" link: (click)

--------------------------------------------
Python
Pexpect was written and tested with Python 2.1. It should work on earlier versions
that have the pty module. ...

pty module
Any POSIX system (UNIX) with a working pty module should be able to run Pexpect.
The pty module is part of the Standard Python Library, so if you are running on
a POSIX system you should have it. The pty module does not run as well on all platforms.
I have taken effort to try to smooth the wrinkles out the different platforms. To
learn more about the wrinkles see Bugs and Testing.

Pexpect does not currently work on the standard Windows Python(see the pty requirement);
however, it seems to work fine using Cygwin. ...

--------------------------------------------

Okay, Jeff, consider your wrist slapped for not even trying... :-)

-Peter
Jul 18 '05 #2
On Wed, 10 Dec 2003 08:57:18 -0500, Peter Hansen <pe***@engcorp.com> wrotf:
Jeff Wagner wrote:

Is there an Expect-like module for Python that is cross platform and, for the most part, does what
Expect does? A number of years ago, I wrote some Tcl scripts using Expect for automation. I am
trying to convince my good friend who I worked with at the time to try Python. He said, "what about
Expect?"

I have heard of a Pexpect but was told that it didn't run on win32 and he needs win32 and Linux
support both.


Hmmm... let's see what Google brings up... (typing)

http://www.google.com/search?q=python+expect

Wow! Look at that! Pexpect is the first hit. Let's try accessing that
page and see what it says. (click) Ah, there's a "Requirements" link: (click)

--------------------------------------------
Python
Pexpect was written and tested with Python 2.1. It should work on earlier versions
that have the pty module. ...

pty module
Any POSIX system (UNIX) with a working pty module should be able to run Pexpect.
The pty module is part of the Standard Python Library, so if you are running on
a POSIX system you should have it. The pty module does not run as well on all platforms.
I have taken effort to try to smooth the wrinkles out the different platforms. To
learn more about the wrinkles see Bugs and Testing.

Pexpect does not currently work on the standard Windows Python(see the pty requirement);
however, it seems to work fine using Cygwin. ...

--------------------------------------------

Okay, Jeff, consider your wrist slapped for not even trying... :-)

-Peter


Ouch ;)

Ok, I did look at it and mentioned in my post that Pexpect doesn't run on win32. The question was,
is there a Expect-like module that does run on win32. I couldn't find one.

Jeff
Jul 18 '05 #3
In article <nk********************************@4ax.com>,
Jeff Wagner <JW*****@hotmail.com> wrote:
On Wed, 10 Dec 2003 08:57:18 -0500, Peter Hansen <pe***@engcorp.com> wrotf:
Jeff Wagner wrote:

Is there an Expect-like module for Python that is cross platform and,for the most part, does what Expect does? A number of years ago, I wrote some Tcl scripts usingExpect for automation. I am trying to convince my good friend who I worked with at the time totry Python. He said, "what about Expect?"

I have heard of a Pexpect but was told that it didn't run on win32and he needs win32 and Linux support both.

Jul 18 '05 #4
Instead of being the newsgroup cop, maybe you should use a little humility
and actually read the post. It's guys like you that scare newbies from
newsgroups. I'll bet you didn't know everything when you posted your last
question.

Luther
"Peter Hansen" <pe***@engcorp.com> wrote in message
news:3F***************@engcorp.com...
Jeff Wagner wrote:

Is there an Expect-like module for Python that is cross platform and, for the most part, does what Expect does? A number of years ago, I wrote some Tcl scripts using Expect for automation. I am trying to convince my good friend who I worked with at the time to try Python. He said, "what about Expect?"

I have heard of a Pexpect but was told that it didn't run on win32 and he needs win32 and Linux support both.
Hmmm... let's see what Google brings up... (typing)

http://www.google.com/search?q=python+expect

Wow! Look at that! Pexpect is the first hit. Let's try accessing that
page and see what it says. (click) Ah, there's a "Requirements" link:

(click)
--------------------------------------------
Python
Pexpect was written and tested with Python 2.1. It should work on earlier versions that have the pty module. ...

pty module
Any POSIX system (UNIX) with a working pty module should be able to run Pexpect. The pty module is part of the Standard Python Library, so if you are running on a POSIX system you should have it. The pty module does not run as well on all platforms. I have taken effort to try to smooth the wrinkles out the different platforms. To learn more about the wrinkles see Bugs and Testing.

Pexpect does not currently work on the standard Windows Python(see the pty requirement); however, it seems to work fine using Cygwin. ...

--------------------------------------------

Okay, Jeff, consider your wrist slapped for not even trying... :-)

-Peter

Jul 18 '05 #5
Luther Barnum wrote:

Instead of being the newsgroup cop, maybe you should use a little humility
and actually read the post. It's guys like you that scare newbies from
newsgroups. I'll bet you didn't know everything when you posted your last
question.


Hmmm... I thought it was guys like me that answer dozens of questions
every week from newbies and others, but maybe I mistook me for someone else.

I did read Jeff's message, though, twice (once before responding, once
before sending). The second time I read it, I noticed (again) that he was
apparently aware that Pexpect did not work under Windows, but note his words:
"I have heard of Pexpect but was told".... a very clear indication that
he didn't know the real and full story, and hadn't visited the site. I tried
to provide in a somewhat humorous way the hint that "Google is your friend",
and I don't think he took offense (nor was any intended). Note also that
my response actually provided additional information as well: the fact that
Pexpect *does* "work fine using cygwin" under Windows, which apparently
Jeff didn't know either.

Yes, I could probably use a little humility, but I don't think you're
attacking me on the right issue here since I did read the post quite
thoroughly.

And no, I "didn't know everything" when I last asked a question here(*),
but I would have visited Google for a while before I did.

I apologize if I scare you, but I don't apologize for making repeated
reminders from time to time that people should do the initial legwork
themselves before asking. Nor, for that matter, do I apologize for
playing "net cop" from time to time and asking people to post test
messages elsewhere, to avoid cross-posting, to remember to change the
subject line when they change the subject, etc. etc. One reason Usenet
has gotten hard to use at times is because of the huge influx of newbies
and a lack of courage on the part of the oldsters to try to educate them
more often on proper netiquette.

-Peter

(*) I don't remember the last time I asked a question, but I believe it
was several months ago. I asked another one sometime last year, and I
think I've asked two others before that. One the other hand, I've posted
roughly ... let's see what Google says ... about 3,190 messages here in
the last three years. And I happen to believe a few of those have actually
helped people... While I actually appreciate attempts to improve my own
behaviour when I'm out of line, I'm fairly certain that I wasn't this time.
Jul 18 '05 #6
In article <3F***************@engcorp.com>,
Peter Hansen <pe***@engcorp.com> wrote:
Jul 18 '05 #7
Cameron Laird wrote:
Long term, the latter might be a greater benefit. I know how
much it means to me when someone helps me learn how to use
resources better.


who has time to learn? wasn't the internet supposed to
eliminate all that?

</F>


Jul 18 '05 #8
Fredrik Lundh wrote:

Cameron Laird wrote:
Long term, the latter might be a greater benefit. I know how
much it means to me when someone helps me learn how to use
resources better.


who has time to learn? wasn't the internet supposed to
eliminate all that?


http://www.google.com/search?q=how+t...sources+better

;-)
Jul 18 '05 #9
In article <3F***************@engcorp.com>,
Peter Hansen <pe***@engcorp.com> wrote:
Fredrik Lundh wrote:

Cameron Laird wrote:
> Long term, the latter might be a greater benefit. I know how
> much it means to me when someone helps me learn how to use
> resources better.


who has time to learn? wasn't the internet supposed to
eliminate all that?


http://www.google.com/search?q=how+t...sources+better

;-)


<URL: http://www.unixreview.com/documents/s=8472/ur0308i/ >, back at you.
--

Cameron Laird <cl****@phaseit.net>
Business: http://www.Phaseit.net
Jul 18 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

29 posts views Thread by Bart Nessux | last post: by
3 posts views Thread by Krzysztof Drozd | last post: by
reply views Thread by joop renes | last post: by
reply views Thread by Gabriel Genellina | last post: by
reply views Thread by drtwkim | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.