By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,900 Members | 1,364 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,900 IT Pros & Developers. It's quick & easy.

capturing text from a GUI window

P: n/a
Anyone know how to capture text from GUI output? I need to process
information returned via a GUI window.

Earl

Jul 18 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Earl Eiland wrote:
Anyone know how to capture text from GUI output? I need to process
information returned via a GUI window.


It might help (at least in terms of justifying this as an
on-topic post) to describe in what way this is a Python
question. Is it a Python program that produces the output?
Do you want to write this capture program using Python?

Also, as always, providing some detail about the platform
in question is important if you don't want to see answers
of the form "we're not mindreaders". Operating system,
GUI framework, versions of things.

Finally, note that the process is, when possible at all,
generally highly platform-specific, awkward, and usually
relies on third-party packages (at least in Windows) that
may or may not have any Python-specific interfaces
available.

-Peter
Jul 18 '05 #2

P: n/a

Earl Eiland wrote:
Anyone know how to capture text from GUI output? I need to process
information returned via a GUI window.

Earl


Assuming Windows, then these guys have an interesting tool:
http://www.skesoft.com/textcatch.htm
It's not free, but you can try it before you buy it.
You will need COM to control it from Python.

Noah

Jul 18 '05 #3

P: n/a
On Tue, 2005-03-08 at 14:27, no**@noah.org wrote:
Earl Eiland wrote:
Anyone know how to capture text from GUI output? I need to process
information returned via a GUI window.

Earl


Assuming Windows, then these guys have an interesting tool:
http://www.skesoft.com/textcatch.htm
It's not free, but you can try it before you buy it.
You will need COM to control it from Python.


This sounds like just what I need. What is COM, and where do I get it?
(I'm really a Linux guy. I don't ken the mysteries of Window very well.)

earl

Jul 18 '05 #4

P: n/a
Earl Eiland wrote:
This sounds like just what I need. What is COM, and where do I get

it?

Also worth checking out:

Simon Brunning's WinGuiAuto - control/query of windows and controls,
including the function getEditText to read the text in an edit control.
See http://www.brunningonline.net/simon/...es/001129.html
You'll probably also need something like Winspector to get class names
etc - see http://www.windows-spy.com/

AutoIt3 - freeware, has a DLL version that is COM-controllable (after
registration using "regsvr32 AutoItX3.dll" from a console window). I
must admit that so far I've only ever used version 2 through COM.
Includes functions such as ControlGetText and WinGetText, and throws in
a separate spy/info program as well. See
http://www.autoitscript.com/autoit3/

COM (component object model) - inter-component communication
technology. See http://www.microsoft.com/com/default.mspx

Makes it easy for programs with COM client functonality to use/control
functions exposed in a COM server program (well, that's the Dispatch
part of it that's applicable to your situation, it's apparently a fair
bit more than that).

Mark Hammond's Python for Windows extensions (thank you Mark Hammond!),
also known as Win32All or PyWin32, adds COM client funcionality to
Python.
(Note: Python+PyWin32 also does COM server stuff, but you don't need to
know about that.)

Use the COM Makepy utility (under the Tools menu) in PythonWin (the IDE
that comes with the Python for Windows extensions) to get a nice
interface module for your chosen COM server component, then just call
the functions in the interface module (or whatever the correct
technical name is for the generated .py file).

Worth reading:
http://www.python.org/windows/win32c...ClientCom.html

Example Python uses of COM server components:
http://www.boddie.org.uk/python/COM.html
http://www.pyzine.com/Issue007/Secti...PythonCOM.html
http://schram.net/articles/python/eudora.html
http://www.daniweb.com/code/snippet208.html
http://tinyurl.com/42rxa

(Using a COM component is very similar in a variety of programming
languages)

In case you don't already have the Python for Windows extensions, or
the ActiveState Python distribution which includes them: see
http://sourceforge.net/projects/pywin32/

Regards, Myles.

Jul 18 '05 #5

P: n/a
Hi Earl,
Anyone know how to capture text from GUI output? I need to process
information returned via a GUI window.

Earl


Assuming Windows, then these guys have an interesting tool:
http://www.skesoft.com/textcatch.htm
It's not free, but you can try it before you buy it.
You will need COM to control it from Python.

This sounds like just what I need. What is COM, and where do I get it?
(I'm really a Linux guy. I don't ken the mysteries of Window very well.)

You may also try WATSUP - Windows Application Test System Using Python:
http://www.tizmoi.net/watsup/intro.html

Now the website seems to be down, but perhaps there is a mirror
somewhere.

Regards,
Josef
Jul 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.