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

2021-01-16 Thread Terry Reedy
On 1/16/2021 9:17 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: A bare minimum skeleton might look something like this: with open(filename) as f: for line in f.readlines(): handle_one_line(f) f.readlines() reads the entire file into a list of lines (strings). If

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

2021-01-16 Thread 2QdxY4RzWzUUiLuE
On 2021-01-16 at 17:46:13 -0500, DonK wrote: > On Sat, 16 Jan 2021 14:56:37 -0600, 2qdxy4rzwzuui...@potatochowder.com > wrote: > > >On 2021-01-16 at 15:42:44 -0500, > >DonK wrote: > >> For example, I've found a need to parse text documents quite a number > >> of times over the years. Basic/VB

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

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

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

2021-01-16 Thread 2QdxY4RzWzUUiLuE
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

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

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

Re: conceptual problem (was: A beginning beginner's question about input, output and . . .

2021-01-14 Thread Greg Ewing
On 14/01/21 11:49 am, Cameron Simpson wrote: The "pure" OOP approach, where method calls are used as messages to set or fetch aspects of the object, is usually does with getter and setter methods like: x = o.getX() o.setX(9) People use get and set methods, not because it's somehow

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

2021-01-14 Thread Peter Pearson
On Wed, 13 Jan 2021 21:46:08 - (UTC), Grant Edwards wrote: > On 2021-01-13, Peter Pearson wrote: [snip] >> Browsergui is not widely popular (I don't think anybody but me has >> mentioned it on this newsgroup), but it was written to be simple and >> Pythonic, and has served me well.

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

2021-01-13 Thread Greg Ewing
On 14/01/21 11:09 am, Grant Edwards wrote: Perhaps I need to recalibrate my adjectives, but with 256KB+ of flash and 32KB+ of RAM, I wouldn't call them "small" It's small by today's standards, when you consider that multiple GB of RAM is commonplace now in most "real" computers. -- Greg --

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

2021-01-13 Thread Greg Ewing
On 13/01/21 7:57 pm, Christian Gollwitzer wrote:  What do you mean, "until" ? https://medium.com/@yon.goldschmidt/running-python-in-the-linux-kernel-7cbcbd44503c He's using Micropython. That's cheating! :-) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

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

2021-01-13 Thread Rich Shepard
On Thu, 14 Jan 2021, dn via Python-list wrote: Concerning the definition of "old" - when I'm having a 'good day', it's anyone several years my senior (and above) - when I'm creaking and groaning, it's anyone remotely my age, and older. About 45 years ago a 25-year-older friend of mine offered

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

2021-01-13 Thread Grant Edwards
On 2021-01-13, Peter Pearson wrote: > On Mon, 11 Jan 2021 15:37:58 -0500, DonK > wrote: > [snip] >> >> 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, > > Agreed. > > Browsergui is not widely

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

2021-01-13 Thread Grant Edwards
On 2021-01-13, Dennis Lee Bieber wrote: > On Tue, 12 Jan 2021 15:18:05 - (UTC), Grant Edwards > declaimed the following: >>On 2021-01-12, songbird wrote: >> >>> it can be used for pretty much anything except perhaps high >>> pressure real time things, but i bet someone else will know that

FridayFinking - Was: A beginning beginner's question about input, output and . . .

2021-01-13 Thread dn via Python-list
On 14/01/2021 04.54, Grimble wrote: > On 11/01/2021 20:37, 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. > At 83, I have no intention of having a programming job again! I last > coded something

Re: conceptual problem (was: A beginning beginner's question about input, output and . . .

2021-01-13 Thread Cameron Simpson
On 13Jan2021 10:37, songbird wrote: > my momentary conceptual problem is that to me OOP means >being able to encapsulate data structures and code from >other parts of the program, but to me it doesn't look like >that is how python is designed. this is probably a complete >aside to this whole

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

2021-01-13 Thread Peter Pearson
On Mon, 11 Jan 2021 15:37:58 -0500, DonK wrote: [snip] > > 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, Agreed. Browsergui is not widely popular (I don't think anybody but me has mentioned

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

2021-01-13 Thread songbird
Christian Gollwitzer wrote: > Am 13.01.21 um 06:24 schrieb Greg Ewing: >> On 13/01/21 4:18 am, Grant Edwards wrote: >> >>> AFAIK, Python can't be used to write device drivers for any popular OS >> >> At least not until some crazy person embeds Python in the >> Linux kernel... > > > What do you

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

2021-01-13 Thread Grimble
On 11/01/2021 20:37, 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. At 83, I have no intention of having a programming job again! I last coded something professionally 45 years ago, but it hasn't lost its

conceptual problem (was: A beginning beginner's question about input, output and . . .

2021-01-13 Thread songbird
Chris Angelico wrote: ...projects that fade... > That's not really something Python can ever control, but I can say > with some confidence that the big libraries like Qt and GTK are going > to adapt, one way or another. And perhaps more importantly: Neither > input()/print() nor web applications

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

2021-01-13 Thread Grimble
On 11/01/2021 20:37, DonK wrote: So, what do you folks use Python for? I've written a shopping list script with auto-completion and a couple of web-scraping applications that support a weather reporting application interfacing with various 1Wire sensors transcribed from an initial Ruby

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

2021-01-12 Thread Christian Gollwitzer
Am 13.01.21 um 06:24 schrieb Greg Ewing: On 13/01/21 4:18 am, Grant Edwards wrote: AFAIK, Python can't be used to write device drivers for any popular OS At least not until some crazy person embeds Python in the Linux kernel... What do you mean, "until" ?

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

2021-01-12 Thread Greg Ewing
On 13/01/21 4:18 am, Grant Edwards wrote: AFAIK, Python can't be used to write device drivers for any popular OS At least not until some crazy person embeds Python in the Linux kernel... -- Greg -- https://mail.python.org/mailman/listinfo/python-list

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

2021-01-12 Thread Grant Edwards
On 2021-01-12, Chris Angelico wrote: > * Command-line calculator - pressing Ctrl-Alt-P will open up a > terminal with Python, and that's the normal way that I do quick > calculations I do that a lot too. -- Grant -- https://mail.python.org/mailman/listinfo/python-list

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

2021-01-12 Thread Cameron Simpson
On 12Jan2021 10:40, Michael F. Stemper wrote: >On 11/01/2021 14.37, DonK wrote: >>I've installed Python 3.7, the PyCharm IDE and watched some Youtube >>tutorials > >I would suggest that instead of watching tutorials, you open up your IDE >and start writing stuff. I would second that. Maybe this

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

2021-01-12 Thread Cameron Simpson
On 12Jan2021 15:18, Grant Edwards wrote: >On 2021-01-12, songbird wrote: >> it can be used for pretty much anything except perhaps >> high pressure real time things, but i bet someone else will >> know that is being done too, i've just not heard of it. :) > >AFAIK, Python can't be used to

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

2021-01-12 Thread Chris Angelico
On Tue, Jan 12, 2021 at 7:41 AM DonK wrote: > So, what do you folks use Python for? > Since everyone else is, I'll add my list. * API lookups of various sorts (usually via HTTP requests) * Audio analysis. Calculate the maximum and average volume of each of many songs. * Code generation. The

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

2021-01-12 Thread Grant Edwards
On 2021-01-12, Chris Angelico wrote: > On Wed, Jan 13, 2021 at 3:18 AM Grant Edwards > wrote: >> >> On 2021-01-12, songbird wrote: >> >> > it can be used for pretty much anything except perhaps >> > high pressure real time things, but i bet someone else will >> > know that is being done too,

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

2021-01-12 Thread Michael F. Stemper
On 12/01/2021 10.40, Michael F. Stemper wrote: Modeling of electric power systems: - load behavior in response to conservation load reduction Sorry, that should have been "conservation voltage reduction". -- Michael F. Stemper Psalm 82:1-4 --

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

2021-01-12 Thread MRAB
On 2021-01-11 20:37, DonK wrote: [snip] So, what do you folks use Python for? Since we're sharing: - Personal information manager in the form of a tree of pages. Each page can have code associated with it which defines functions to call when shortcut keys are pressed, giving

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

2021-01-12 Thread Michael F. Stemper
On 11/01/2021 14.37, DonK wrote: I've installed Python 3.7, the PyCharm IDE and watched some Youtube tutorials I would suggest that instead of watching tutorials, you open up your IDE and start writing stuff. Get an introductory python book (I used the O'Reilly _Introducing Python_), start at

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

2021-01-12 Thread Chris Angelico
On Wed, Jan 13, 2021 at 3:18 AM Grant Edwards wrote: > > On 2021-01-12, songbird wrote: > > > it can be used for pretty much anything except perhaps > > high pressure real time things, but i bet someone else will > > know that is being done too, i've just not heard of it. :) > > AFAIK, Python

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

2021-01-12 Thread Grant Edwards
On 2021-01-12, songbird wrote: > it can be used for pretty much anything except perhaps > high pressure real time things, but i bet someone else will > know that is being done too, i've just not heard of it. :) AFAIK, Python can't be used to write device drivers for any popular OS (Linux,

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

2021-01-12 Thread Grant Edwards
On 2021-01-11, DonK wrote: > So, what do you folks use Python for? I mainly use it for writing command-line utilities. Many of them work on either Windows or Linux, but are mostly used on Linux: * Two-pass symbolic assembler and dissassembler for a proprietary communications controller.

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

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 5:26 PM songbird wrote: > for python i just spend too much time fumbling around > and i don't really know what is current and if i'm using > something that will be kept up for the future or if the > project is going away or in a direction that i won't like > (both KDE

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

2021-01-11 Thread songbird
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. It's been about 18-19 years since my last programming job. >

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

2021-01-11 Thread Abdur-Rahmaan Janhangeer
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

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

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 3:16 PM Greg Ewing wrote: > > 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. > > That sounds like it should be doable if you can get access to the >

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

2021-01-11 Thread Greg Ewing
On 12/01/21 9:37 am, DonK wrote: 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 . . .

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

2021-01-11 Thread Cameron Simpson
On 11Jan2021 15:52, Dan Stromberg wrote: >On Mon, Jan 11, 2021 at 2:22 PM Cameron Simpson wrote: >> >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

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

2021-01-11 Thread Dan Stromberg
On Mon, Jan 11, 2021 at 2:22 PM Cameron Simpson wrote: > >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

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

2021-01-11 Thread Chris Angelico
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,

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

2021-01-11 Thread Cameron Simpson
On 11Jan2021 15:37, 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. Therefore you're happy with classes, and are

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

2021-01-11 Thread dn via Python-list
On 12/01/2021 09.37, 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. It's been about 18-19 years since my

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

2021-01-11 Thread Chris Angelico
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. It's been about 18-19

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