Thank you for your help. There have been several great ideas thrown out for consideration. Noah, you are correct when you say there are commercial solutions, but they are very pricey (est $4,000 for the development license and 2-3,000 for runtime per client)!!! I will keep the listserv updated on what I find out.. Thank you for all the direction provided.
-----Original Message----- From: Noah [mailto:[EMAIL PROTECTED]] Sent: Friday, November 16, 2001 12:15 AM To: [EMAIL PROTECTED] Subject: RE: Controlling win32 application Ah, so it IS screen scraping, then! I don't think you want to use pipes in this case... Ahh! This project sounds almost exactly like the first big job of my career! Of course, then we wrote it in C and we had nervous breakdowns. If this was a serious, long life application then I would create a Telnet class that processed the VT escape codes into a virtual "screen" from which you could scrape information. Writing VT escape code parsing classes would be a drag (that's where the nervous breakdowns come in). If you are still eager to use Windows telnet, then you could try the Win key message idea that I mentioned, followed by some clever code to select and copy to the clipboard. Your code would send WM_KEYDOWN messages to the telnet window. Or maybe it's WM_KEYUP messages... plus throw in some miscellaneous WM_* messages to select all and then copy the buffer to the clip-board... do you get the idea? You can run a WM message spy on the telnet to see how it responds to messages. But Microsoft's telnet is also notoriously bad at displaying VT escape codes anyway. I would not trust it, so you are back to rolling your own or you might consider finding a third-party telnet application or VT escape code library that allows easier interfacing. Probably you could extract the C code brain from some GNU product out there. That's easy to interface with Python. Finally, there are many packages (mostly expensive) out there that already do all this screen scraping stuff. Could you consider a ready-made package? Let me know if you are interested in having me doing some paid contract or FTE work on this. I got laid off :-( and this looks like a fun project. If not, then I'm still happy to discuss it. Yours, Noah -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Russell Blank Sent: Thursday, November 15, 2001 9:54 AM To: 'Noah' Cc: [EMAIL PROTECTED]; "Steve"@smtp1.ActiveState.com 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