A beginning beginner's question about input, output and . . .

DonK don81846 at comcast.net.invalid
Sat Jan 16 17:46:13 EST 2021


On Sat, 16 Jan 2021 14:56:37 -0600, 2QdxY4RzWzUUiLuE at potatochowder.com
wrote:

>On 2021-01-16 at 15:42:44 -0500,
>DonK <don81846 at comcast.net.invalid> wrote:
>
>> Yes, Windows. Iterating open windows with the Window's API is easy the
>> hard (very hard) part is sending keystrokes to those windows to Save
>> them. It's very tricky because the timing is critical. 
>> 
>> You have to use one of those "spy" utilities to get the name and
>> classid for the controls that you want to send a command to, then use
>> the Window's API functions SendMessage or PostMessage to send the
>> message directly to the control or just put it in the message que.
>>  
>> Like sending an "s" to the File menu to (S)ave. It's more complicated
>> than you would think and it doesn't work very well. It's like pushing
>> on a string. 
>
>Then don't do that?  ;-)
>
>I'm no Windows expert (nor even a user), but do those applications have
>a scripting interface?  (DDE?  OLE?  COM?  Do those letters ring a bell?
>The right bell?  Are those technologies current?)  What you're trying to
>do sounds like working *against* those applications rather than with
>them.

No! I've used the interfaces that you mentioned (OLE and COM in
particular) but that was for apps that I, or my colleagues, wrote (for
an employer) "to expose their guts" many years ago. I've found few
general use Windows apps that support any form of scripting. MS Office
apps, famously, support OLE. Or they used to. My copy of Office is
2007 so I don't know about the newer versions. I think most of those
technologies might have died a long time ago but I could be entirely
wrong. Does Python use those methods to control Excel, etc??

There was a Windows Usenet app, that I was interested in, around 10,
maybe 20 years ago that exposed a Pascal language like interface but
there was no documentation and no support. I believe it only lasted a
short time. I'm pretty sure that it's name started with a "D". It
doesn't matter.

I tried the method that I described above with the Forte Agent
newsreader back in the dial-up days because people in one of the
programming newsgroups wanted to be able to upload/dowanload
(unattended) in the middle of the night. It might have been possible
to get it to work reliably but I gave up on it.

>
>> For example, I've found a need to parse text documents quite a number
>> of times over the years. Basic/VB is great at doing that. How's
>> Python?

>
>Python can do that.  Can you expand on "parse" and "text documents"?

There's nothing that I have any particular need for at the moment but
it is something that I've done a number of times over the years. I
think it's a common need?? 

I've used Pascal and BASIC\VB for string parsing and BASIC\VB is much
better. VB has all the string handling functions that you need built
in but, for example, Pascal has some but you have to create others to
be useful. Since I'm just beginning with Python I have no knowledge or
criticism of how Python does this but I'm sure that it can.

Since I've retired I've written parsers for my bank records, medical
records and other personally useful things. I would categorize them as
trivial but useful.  i.e utility means useful

When I was working, in the 1999-2001 range, I wrote a parser in VB
that unscrambled corrupted "batch files" for credit card processing so
that vendors didn't have to spend hours rebuilding them by hand. Some
of those files had over 700 credit card transactions in them. That's
one example.

I'm looking forward to learning some Python, mostly for fun, but I'm
sure that it will also be useful.


Thank you

	Don


More information about the Python-list mailing list