Python+Expect+Win32 = Not Possible?

G

gamename

Hi,

Is it still the case there is no practical Expect-like module for
win32? I know that cygwin can support pexpect, but that isn't an
option here --- I have to use a native win32 Python version.

Are there alternatives, or is it simply not an option to replicate
Expect on win32 with python?

All I'm trying to do is start a couple processes, wait for each to say
"done" on stdout and then quit (or timeout if something went wrong).

TIA,
-T
 
H

half.italian

Hi,

Is it still the case there is no practical Expect-like module for
win32? I know that cygwin can support pexpect, but that isn't an
option here --- I have to use a native win32 Python version.

Are there alternatives, or is it simply not an option to replicate
Expect on win32 with python?

All I'm trying to do is start a couple processes, wait for each to say
"done" on stdout and then quit (or timeout if something went wrong).

TIA,
-T

I had planned on using telnet to do the same thing on windows. I
don't think I ever proved it, but I'm pretty sure it will work.

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52228

~Sean
 
G

gamename

I had planned on using telnet to do the same thing on windows. I
don't think I ever proved it, but I'm pretty sure it will work.

Thanks, Sean. The problem is that telnet is generally disabled on
most hosts nowadays.
 
T

Tim Golden

gamename said:
Thanks, Sean. The problem is that telnet is generally disabled on
most hosts nowadays.

I'm not sure whether the need you describe above "start a
couple [of] processes, wait for each to say 'done' and
then quit (or timeout...)" is *all* of your requirements
or just an example. And are these processes running on
remote machines? Or just locally?

Depending on those things, maybe there are other ways
to do what you want under Windows?

(I've checked back through the archives and I can't find
any earlier posts describing the requirement more clearly).

TJG
 
P

Philem

Hi,

Is it still the case there is no practical Expect-like module for
win32? I know that cygwin can support pexpect, but that isn't an
option here --- I have to use a native win32 Python version.

Are there alternatives, or is it simply not an option to replicate
Expect on win32 with python?

All I'm trying to do is start a couple processes, wait for each to say
"done" on stdout and then quit (or timeout if something went wrong).

TIA,
-T

You could try this link: http://www.activestate.com/Products/activetcl/features.plex
and see if that gives you what you need.

Luck!
-J
 
G

gamename

Thanks, Sean. The problem is that telnet is generally disabled on
most hosts nowadays.

I'm not sure whether the need you describe above "start a
couple [of] processes, wait for each to say 'done' and
then quit (or timeout...)" is *all* of your requirements
or just an example. And are these processes running on
remote machines? Or just locally?
Good question. That's part of the requirements. The rest are: The
processes need to be async (i.e. the script doesn't stop while waiting
for the process to complete). They also need some kind of timeout
mechanism so that the processes don't run forever. All processes are
local.
 
C

Cameron Laird

Thanks, Sean. The problem is that telnet is generally disabled on
most hosts nowadays.
.
.
.
I'm plenty confused about who's saying what now. Yes,
well-run modern hosts disable telnetd; I think the
original description, though, was about use of telnet
to connect to hardware devices which provide some
simple TCP/IP (or serial-line?) service. Windows
still builds in the telnet *client* ...

.... which might well be superfluous. If these
hardware devices (did I understand that part correctly?)
are just simple network servers, and don't, for example,
demand authentication, Python's socket library can be
used directly (and even portably!), without involvement
of Expect capabilities or an external telnet executable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top