473,224 Members | 1,324 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 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 3090
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: Bart Nessux | last post by:
Just fooling around this weekend. Wrote and timed programs in C, Perl and Python. Each Program counts to 1,000,000 and prints each number to the console as it counts. I was a bit surprised. I'm not...
7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
3
by: Phillip | last post by:
Some people tipped me off on some possibilities to tackle my https problem. Those have definitely gotten me further in cornering the problem. Thank you. But: No matter what I do to open a...
3
by: Krzysztof Drozd | last post by:
how to configure apache 2 to work with python or mod_python? krzysiek ps: sory,my english is't perfect :)
5
by: robert | last post by:
Turning algs for old NumPy modules into numpy code I suffer from this: Upon further processing of returns of numpy calculations, lots of data in an apps object tree will become elementary numpy...
0
by: joop renes | last post by:
hi, i hope this is the right list for the following question of a c++ hacker,python newbie. i have a library in c++ to which i want to add a python GUI and other python stuff.The library has...
0
by: Gabriel Genellina | last post by:
En Sun, 04 May 2008 11:56:14 -0300, joop renes <jj.renes@hccnet.nlescribió: Python objects are reference counted, *and* you can have many threads running. This is not a problem in itself; Python...
0
by: drtwkim | last post by:
Hi.. I can't speak english very well. I have writting code a program with VB & Python - COM Server : Visual basic (ActiveX EXE) - COM Client : Python I expect to attempt that is retrieved...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.