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

DonK don81846 at comcast.net.invalid
Sat Jan 16 15:42:44 EST 2021


On Mon, 11 Jan 2021 21:56:48 -0800, Paul Rubin
<no.email at nospam.invalid> wrote:

>DonK <don81846 at comcast.net.REMOVEME> writes:
>> My problem is that I don't understand how Python programs are
>> used. (i.e user input and output) Is Python mainly used for backends?
>> I've seen some Python gui frameworks like Tkinter, PyQt, etc....
>
>I would say at least for me, the i/o to my python programs tends to be
>be either files or network sockets.  I've written some fairly complex
>tkinter apps in the past, but these days, desktop GUI's almost seem like
>a 1990s thing.  If you want an interactive program, either it's a mobile
>app (Python is not so great at that, though see kivy.org) or a web app
>(so the user interacts with it through a browser).
>
>> So, what do you folks use Python for?
>
>Pretty much everything unless a) it's someone else's application written
>in another language so I have to use the other language; b) I need raw
>performance (C, C++) or some other specialized feature; or c) I want to
>get more practice with some other language (quite a few).
>
>> if the titlebar contains certain strings
>
>Yeah this sounds like a Windows thing.  I don't have any idea what it
>takes to make those Windows calls in Python since I'm mostly a Un*x
>programmer.

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. 


>
>> I know that Python is a very popular language so I'm sorry if it
>> sounds like I'm being critical. I really don't know enough about it to
>> be critical.
>
>If you're familiar with Javascript or Visual Basic, my impression is
>that Python is at about the same level, but with a (for me) subjectively
>cleaner style.  It doesn't have a static type system or a lot of
>boilerplate, so it's easy to bang out small scripts; but the compiler
>doesn't supply much long range error checking, so you have to be pretty
>devoted to test automation if you're doing anything sizeable.  There is
>now a syntax for optional type annotations in Python, and a tool called
>mypy for checking types based on the annotations.  The Python compiler
>itself ignores the annotations.  I've been using them and like them.


Hi Paul,

I doubt that I'll be doing anything sizeable, mostly just a little
learning and entertainment with an occasional small utility once in a
while. But, who knows?

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?


Thanks,

	Don


More information about the Python-list mailing list