Re: getting text from WinXP console

2005-03-22 Thread Cappy2112
Popen(args='c:\\WINDOWS\\system32\\command.com' Don't launch command.com, try running the actual program you are interested in in capturing the text for. Although you should be able to run the command interpreter too- I don't know why that didn't work. There are several variations of popen, so

Re: getting text from WinXP console

2005-03-22 Thread Mark T.
Chris Maloof [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, Does anyone know how I can read the ASCII text from a console window (from another application) in WinXP? It doesn't sound like a major operation, but although I can find the window via pywin32, I haven't been

Re: getting text from WinXP console

2005-03-21 Thread Jeff Schwab
Lucas Raab wrote: Chris Maloof wrote: Hello, Does anyone know how I can read the ASCII text from a console window (from another application) in WinXP? It doesn't sound like a major operation, but although I can find the window via pywin32, I haven't been able to do anything with it. I'd really

Re: getting text from WinXP console

2005-03-21 Thread Lucas Raab
Chris Maloof wrote: Hello, Does anyone know how I can read the ASCII text from a console window (from another application) in WinXP? It doesn't sound like a major operation, but although I can find the window via pywin32, I haven't been able to do anything with it. I'd really just like to get

Re: getting text from WinXP console

2005-03-21 Thread Lucas Raab
Jeff Schwab wrote: Lucas Raab wrote: Chris Maloof wrote: Hello, Does anyone know how I can read the ASCII text from a console window (from another application) in WinXP? It doesn't sound like a major operation, but although I can find the window via pywin32, I haven't been able to do anything

Re: getting text from WinXP console

2005-03-21 Thread Cappy2112
If you re-direct the output to a file, then you won't see it on the console at all, unless the program writes to stderr separately. -- http://mail.python.org/mailman/listinfo/python-list

Re: getting text from WinXP console

2005-03-21 Thread Cappy2112
Are you the one who is launching the Nethack program, or is it already running, and you ar e trying to capture the text after Nethack is launched ? If you are launching it you can try using one of the python popen() calls to redirect the screen output to your python program. I havne't doen this

Re: getting text from WinXP console

2005-03-21 Thread Jeff Shannon
Lucas Raab wrote: Chris Maloof wrote: Does anyone know how I can read the ASCII text from a console window (from another application) in WinXP? It doesn't sound like a major operation, but although I can find the window via pywin32, I haven't been able to do anything with it. I'd really just

Re: getting text from WinXP console

2005-03-21 Thread Peter Hansen
Jeff Shannon wrote: Unless I'm seriously mistaken, the only way that this will be possible is if there's a Win32 API call that will give the correct information. This might be possible to find in the MSDN documentation, if it exists, but I suspect that it probably doesn't. Just thinking: in

Re: getting text from WinXP console

2005-03-21 Thread Ron
On Mon, 21 Mar 2005 12:06:03 -0800, Jeff Shannon [EMAIL PROTECTED] wrote: Actually, there's probably a second way -- capture the window image as a bitmap, and then run OCR software on it. There's also OCR aware clipboard software that can cut a selected area from the screen, convert the graphic

Re: getting text from WinXP console

2005-03-21 Thread Jeff Shannon
Peter Hansen wrote: Jeff Shannon wrote: Unless I'm seriously mistaken, the only way that this will be possible is if there's a Win32 API call that will give the correct information. This might be possible to find in the MSDN documentation, if it exists, but I suspect that it probably doesn't.

Re: getting text from WinXP console

2005-03-21 Thread Chris Maloof
Thanks for the interesting suggestions! On 21 Mar 2005 10:47:52 -0800, Cappy2112 [EMAIL PROTECTED] wrote: If you are launching it you can try using one of the python popen() calls to redirect the screen output to your python program. Aha. This sounds perfect, and I don't know why it doesn't

getting text from WinXP console

2005-03-20 Thread Chris Maloof
Hello, Does anyone know how I can read the ASCII text from a console window (from another application) in WinXP? It doesn't sound like a major operation, but although I can find the window via pywin32, I haven't been able to do anything with it. I'd really just like to get the window text into

Re: getting text from WinXP console

2005-03-20 Thread Chris Rebert (cybercobra)
You want the function raw_input(). Have you read the tutorial? I should have been covered there. -- http://mail.python.org/mailman/listinfo/python-list