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

2021-01-16 Thread DonK
On Tue, 12 Jan 2021 09:26:18 +1100, Chris Angelico 
wrote:

>On Tue, Jan 12, 2021 at 7:41 AM DonK  wrote:
>> Hi, I'm thinking about learning Python but I'm 74 years old and will
>> very likely not ever have a programming job again. I used to program
>> in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe"
>> languages.
>
>BTW, from my experience, there's very very few languages so obscure
>that not one person on this list has heard of them :)
>
>For example, I've used REXX, which is an IBM language found on some of
>the mainframes and also on OS/2, and I'm not the only person here who
>has.
>
>ChrisA

Hi Chris,

The mainframe language that I mentioned was/is? called KwikBasic. I
don't remember if it was all one word or not. It's not to be confused
with Microsoft's QuickBasic.

KwikBasic ran on the Unix OS and was, hands down, the worst
programming experience I've ever had. It was a Y2k fix for the
reservation system of a large Fortune 500 real estate "timeshare"
company. I probably shouldn't say that their name was Trendswest.

The update had to be completed by the end of October 1998 because they
would start taking reservations for 2000 in Nov, 1998. They hired me
to manage the "reservation" part of their Y2k update in the Summer.
(YES! It was late.)

It turned out that KwikBasic was VERY much like the other versions of
basic that I had used. Including MSDOS's QuickBasic and PDS. The two
nutty things about it were that it had only 2 data types, if I
remember corectly they were called number and string.

The worst thing was that there was just one directory that contained
2,702 source files (I'll never forget that number) with names like
217h9436. There was no index to tell you what 217h9436 was, what it
did, what part of the business it pertained to . . . nothing. There
was also no notation in the files. You just had to open each one of
them, read their code to find out what they did.

Also, we had Windows computers on our desks with MS Office installed
but the nearest computer that could run Kwikbasic was their UNIX
mainframe in the main buildings about .25 to .50 miles away. We were
supposed to write code at our desk with Windows Notepad and then, on
Fridays,  the IT manager would take our code over to compile it and
would let us know of any error codes. They said they were going to buy
some expensive workstation for our office, that would run RedHat,
which they were told would then run Kwikbasic. IDunno!

It would have been impossible to do the job as the IT mgr (Mike W.)
envisioned it but I was able to write some simple MS Office code that
searched all the source code files, in just a minute or 2, for any
reference to "Date" functions. As I recall, there weren't that many.

Anyway, Mike W. was a fool that spent all day, every day, screaming
about, mostly, politics. I wound up quitting iafter less than 2 weeks.

Thanks for replying and sorry for the long message.

Don
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2021-01-16 Thread DonK
On Mon, 11 Jan 2021 21:56:48 -0800, Paul Rubin
 wrote:

>DonK  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
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2021-01-16 Thread DonK
On Tue, 12 Jan 2021 10:16:47 +0400, Abdur-Rahmaan Janhangeer
 wrote:

>Greetings,
>
>Web with Python is really easy to get started with, here
>is a simple endpoint with a framework called Flask
>
>from flask import Flask
>app = Flask(__name__)
>
>@app.route('/')
>def hello_world():
>   return 'Hello WorldÂ’
>
>if __name__ == '__main__':
>   app.run()
>
>As for Tkinter, it's really annoying.
>PyQt5 and others are a lot better.
>PyQt5 follows the Cpp function namings
>
>Kind Regards,
>
>Abdur-Rahmaan Janhangeer

Someone else also suggested a web interface for i/o. If I get that far
it seems like it will be something I'll need to take a look at.

A lot of my early programming was command line BASIC apps running on
MSDOS. Even some pretty BIG stuff. So, going back to that after 40+
years seems a little weird. :-)

I looked at some Youtube videos about creating mobile apps with Java
but that just didn't do it for me. As far as I've seen there isn't
really a way to do the small "ad hoc" type of utilities on a
smartphone that you can do on a desktop machine.

Don't get me wrong, I love my smartphone.  

Thanks, 

Don
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2021-01-16 Thread DonK
On Sat, 16 Jan 2021 14:56:37 -0600, 2qdxy4rzwzuui...@potatochowder.com
wrote:

>On 2021-01-16 at 15:42:44 -0500,
>DonK  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
-- 
https://mail.python.org/mailman/listinfo/python-list


Does anyone know if there Is a 'Code Snippet' add-in for PyCharm

2021-02-25 Thread DonK



Thank you

Don
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2021-01-11 Thread DonK


Hi, I'm thinking about learning Python but I'm 74 years old and will
very likely not ever have a programming job again. I used to program
in Visual Basic, C\C++, Delphi, etc. and some obscure "mainframe"
languages. It's been about 18-19 years since my last programming job.
I do understand programming concepts but I'm really not up on any of
the more modern programming languages.

I've installed Python 3.7, the PyCharm IDE and watched some Youtube
tutorials but it's been stretched out over about 1.5 years so I'll
probably need to go back to the beginning. 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. but they
look kinda like adding a family room onto a 1986 double wide mobile
home, and they look even more complicated than creating a GUI from
scratch in C++ with a message loop, raising events . . .

So, what do you folks use Python for?

Nowdays I mainly just use programming for rather small utilities for
my personal use. Currently I'd like to write something to iterate
through open windows and save them to different folders depending on
if the titlebar contains certain strings. In the past I would probably
have used Excel's VBA to do this but I no longer have Excel installed
on my main computer. I'd like a bit of a challenge but I don't want to
spin my wheels trying to learn something that will be a dead end for
me.

I know that this probably seems like a stupid post but your input will
be useful.

Thank you.

   Don

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.
-- 
https://mail.python.org/mailman/listinfo/python-list