Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Is it possible to extract text from a program using python


rynagade's Avatar
Member
0 0

I have been working on learning python for several months now and am fairly new to programming. Meanwhile my fiance is taking a typing course but is developing carpal tunnel syndrome. To help out I decided to write a program to help her out. I've gotten it to do the typing and can manually tweak the speed so it's not the same every assignment. I intended on making it read the text from the program (Keychamp 2.0) and input it strait back into it instead of me having to type it up the first time. Using a program I downloaded called Windows Detective I was able to find the handle for the frame that contained the text but don't know enough to know what to do with it. Even though the semester is practically over I would still like to finish it up. Any guidance or tips would be greatly appreciated.

Here is what I have so far: http://pastebin.com/9xgthRz8


elmiguel's Avatar
Member
2,795 1

This reminds of the old AOL days when I used to make Chat progz and IM punters! LOL, anyway, you need to get the handle the area in the app the holds the text. Once you have that you will be able to read / edit or whatever is possible for that program. I do know that Keychamp2.0 so I cannot test what you have at the moment.


maug2's Avatar
Member
0 0

I had to do a lot of this about a year ago, but I used bash/linux. I think the easiest way to do this would be by piping grep into awk, and outputting that into a text file. Grep the file, and define some delimiters for awk. It's going to be a long one-liner.

Sorry I don't have some sample code at hand. I have some somewhere on some drive, and sometime I'll get around to it.

Wouldn't this kinda defeat the purpose of a typing class? =P Might be best just to stretch/shake your wrists and arms every 15-30 minutes until the carpel tunnel goes away. And stay well hydrated.


elmiguel's Avatar
Member
2,795 1

maug, the program is on a windows machine, Linux won't work here. If you saw the pastebin you would have saw the win32 imports.