Hi Russell,
It sounds like you need something like Expect.  Expect is specifically
designed for trapping and controlling things like terminal or telnet
sessions.
I've only used the original TCL version of Expect, but there is a Python
version.
Check out:
http://expectpy.sourceforge.net/

I haven't tried it out so I don't know if it works with Python 2.1, or if
ExpectPy is being maintained any more.  If it works it would be a whole lot
nicer than learning a language like TCL.

I hope this helps.

John Kirkham

----- Original Message -----
From: "Russell Blank" <[EMAIL PROTECTED]>
To: "'Noah'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <"Steve"@smtp1.ActiveState.com>
Sent: Thursday, November 15, 2001 12:54 PM
Subject: RE: Controlling win32 application


> No, I am not crazy (at least I think).  The reason why I want to automate
> this process is for rapid development of screen scraping.  I have used
> telnetlib, but interpreting escape codes and trying to discover where you
> are on the screen is an arduous task.  I want to do the following:
>
> 1.  Create a python script to obtain and save information to a CUI
program.
> 2.  Aid in development by having that process (via a switch) launch a
telnet
> window with the appropriate emulation already built in.
> 2.  Be able to view my python script as it runs to aid in the development
> process (and not just see the raw data dump)
>
> If the answer is pipes, I have not had much experience using them.  Is
there
> examples that you might be able to direct me too?
>
> Thanks for your help...
>
> -----Original Message-----
> From: Noah [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 14, 2001 6:28 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Controlling win32 application
>
>
>
> I have done some Win32 automation.
> I'm guessing there is a good reason for these gymnastics
> that make it impossible to simply use the Python telnet library. Yes?
>
> To clarify: Do you want a Python script to start a win32 telnet window
> then have the Python script send key strokes to the telnet window
> and capture the results (python script starts the telnet process)?
> Or do you want a separate Python script to send key commands to
> any given existing telnet window (Python script and telnet are
> independent processes)? The first is easy (pipes). The second is harder.
> You can send key messages to a window, but I'm not sure if you can easily
> get data back. Your requirements don't say that you need to get the data
> back.
> If not, then it should be relatively easy, if a little ugly, to send Win
> key messages. If you do need to process the results then I could imagine
> some hacks with a copy and paste using the clip-board or maybe DDE
> -- that is, Screen Scraping. Do you want to go that route?
>
> Let me know if you can provide more information... or if someone
> else provides an elegant solution to the problem.
>
> Yours,
> Noah
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Russell
> Blank
> Sent: Wednesday, November 14, 2001 5:09 PM
> To: [EMAIL PROTECTED]
> Subject: Controlling win32 application
>
>
> Question:  Has anyone controlled a win32 program with python?
>
> I want to launch a telnet window, have it open, and run a python script
and
> see those commands sent through the telnet window.  Has anyone had
> experience?
>
> Russell A. Blank
> Senior Consultant
> Atlas Development Corporation
> 6351 Owensmouth Avenue, #101
> Woodland Hills, CA 91367
> (818) 340-7080 Phone
> (818) 340-7079 Fax
>
>
>
> _______________________________________________
> ActivePython mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activepython
>

_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython

Reply via email to