Clearing the Deque • Picturing Python’s `deque` data structure

2023-11-07 Thread dn via Python-list
You will be welcome to join us at our next (hybrid) meeting: Wednesday, 15 November 2023, 1815~2030 NZDT (0515~0730 UTC). How often do you use a deque*? “Not very” is a common answer. Perhaps you’ve never used it. In this presentation, Stephen won’t try to convince you to use it more often. I

Re: fCONV_AUSRICHTG is not defined - Why?

2023-11-07 Thread MRAB via Python-list
On 2023-11-07 19:20, Jim Schwartz via Python-list wrote: Where do you define fCONV_AUSRICHTG? It must be initialized or defined somewhere. Did you leave out a statement from the python 2 version? It's given its value here: ( fNAME, fLG1, fLG2,

Re: fCONV_AUSRICHTG is not defined - Why?

2023-11-07 Thread MRAB via Python-list
On 2023-11-07 20:56, Thomas Passin via Python-list wrote: On 11/7/2023 3:29 PM, MRAB via Python-list wrote: On 2023-11-07 19:20, Jim Schwartz via Python-list wrote: Where do you define fCONV_AUSRICHTG? It must be initialized or defined somewhere. Did you leave out a statement from the python 2

Re: Beep on WIndows 11

2023-11-12 Thread jak via Python-list
Rob Cliffe ha scritto:  Apologies if this is not a Python question. I  recently moved from a WIndows 10 laptop to a Windows 11 one. Although there is nothing wrong with the sound on the new machine (I can listen to podcasts and watch videos), I find that outputting "\a" to the console (aka std

Re: Beep on WIndows 11

2023-11-12 Thread MRAB via Python-list
On 2023-11-12 11:16, Chris Angelico via Python-list wrote: On Sun, 12 Nov 2023 at 21:27, Y Y via Python-list wrote: I am curious and humble to ask: What is the purpose of a BEEP? There are several purposes. I can't say which of these are relevant to the OP, but some or all of them

Re: xor operator

2023-11-13 Thread Barry via Python-list
> On 13 Nov 2023, at 15:16, Dom Grigonis via Python-list > wrote: > > I think it could be useful to have `xor` builtin, which has API similar to > the one of `any` and `all`. I do not understand how xor(iterator) works. I thought xor takes exactly 2 args. I also do not und

Re: No current way to just compile flet code into truly native packages for smart phones, etc.?

2023-11-13 Thread Barry via Python-list
> On 13 Nov 2023, at 17:21, Jacob Kruger via Python-list > wrote: > > Had a look at the following bit of introduction to using python and flet to > build cross-platform flutter-based apps using same python code, and, while it > seems to work alright if tell it to run as

Re: xor operator

2023-11-13 Thread Barry via Python-list
> On 13 Nov 2023, at 17:48, Dom Grigonis wrote: > > Short circuiting happens, when: > xor([True, True, False, False], n=1) > At index 1 it is clear that the answer is false. Can you share an example with 4 values that is true? And explain why it is xor. Barry -- https://mail.python.org/mai

Re: xor operator

2023-11-13 Thread MRAB via Python-list
On 2023-11-13 21:03, Barry via Python-list wrote: On 13 Nov 2023, at 17:48, Dom Grigonis wrote: Short circuiting happens, when: xor([True, True, False, False], n=1) At index 1 it is clear that the answer is false. Can you share an example with 4 values that is true? And explain why it is

Re: Code improvement question

2023-11-14 Thread MRAB via Python-list
On 2023-11-14 23:14, Mike Dewhirst via Python-list wrote: I'd like to improve the code below, which works. It feels clunky to me. I need to clean up user-uploaded files the size of which I don't know in advance. After cleaning they might be as big as 1Mb but that would be super rar

Re: Code improvement question

2023-11-14 Thread MRAB via Python-list
On 2023-11-15 03:41, Mike Dewhirst via Python-list wrote: On 15/11/2023 10:25 am, MRAB via Python-list wrote: On 2023-11-14 23:14, Mike Dewhirst via Python-list wrote: I'd like to improve the code below, which works. It feels clunky to me. I need to clean up user-uploaded files the si

Re: Newline (NuBe Question)

2023-11-15 Thread dn via Python-list
On 15/11/2023 20.25, Grizzy Adams via Python-list wrote: Hi & thanks for patience with what could be simple to you Have this (from an online "classes" tutorial) There are lots of on-line classes! --- Start Code Snippit --- students = [] grades = [] for s in

Re: Code improvement question

2023-11-16 Thread MRAB via Python-list
On 2023-11-17 01:15, Mike Dewhirst via Python-list wrote: On 15/11/2023 3:08 pm, MRAB via Python-list wrote: On 2023-11-15 03:41, Mike Dewhirst via Python-list wrote: On 15/11/2023 10:25 am, MRAB via Python-list wrote: On 2023-11-14 23:14, Mike Dewhirst via Python-list wrote: I'd li

Re: Code improvement question

2023-11-17 Thread jak via Python-list
Mike Dewhirst ha scritto: On 15/11/2023 10:25 am, MRAB via Python-list wrote: On 2023-11-14 23:14, Mike Dewhirst via Python-list wrote: I'd like to improve the code below, which works. It feels clunky to me. I need to clean up user-uploaded files the size of which I don't know

Re: Code improvement question

2023-11-17 Thread MRAB via Python-list
On 2023-11-17 09:38, jak via Python-list wrote: Mike Dewhirst ha scritto: On 15/11/2023 10:25 am, MRAB via Python-list wrote: On 2023-11-14 23:14, Mike Dewhirst via Python-list wrote: I'd like to improve the code below, which works. It feels clunky to me. I need to clean up user-upl

Re: Code improvement question

2023-11-17 Thread jak via Python-list
MRAB ha scritto: Bare excepts are a very bad idea. I know, you're right but to test the CAS numbers were inside a string (txt) and instead of the 'open(file)' there was 'io.StingIO(txt)' so the risk was almost null. When I copied it here I didn't think about it. Sorry. -- https://mail.python.

NZPUG Mtg: Making Python faster, and "Dependency Inversion"

2023-11-22 Thread dn via Python-list
Virtual meeting: Wednesday 6 December, 1815 for 1830 NZDT/UTC+13 Book at https://www.meetup.com/nzpug-auckland/events/295433876/ 1 Making Python faster - using type hints Tushar will lead us through: A brief history of type hints Using type checkers to verify your type hints Compil

Re: on writing a number as 2^s * q, where q is odd

2023-11-29 Thread jak via Python-list
Alan Bawden ha scritto: Julieta Shem writes: How would you write this procedure? def powers_of_2_in(n): ... def powers_of_2_in(n): return (n ^ (n - 1)).bit_count() - 1 Great solution, unfortunately the return value is not a tuple as in the OP version. Maybe in this way?

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 professi

Re: Application window geometry specifier

2021-01-13 Thread dn via Python-list
On 14/01/2021 15.25, boB Stepp wrote: > On Wed, Jan 13, 2021 at 7:28 PM Chris Angelico wrote: > >> I love how "I think" is allowed to trump decades of usability research. I'm just pleased that @Chris has found love! (not detracting from the point though) > Can you recommend a good reference fo

Friday Finking: Abstract Base Classes - love or hate

2021-01-14 Thread dn via Python-list
Do you make frequent use of Abstract Base Classes (ABCs), prefer to use an ordinary super-class for the same purpose, or steer-clear? Are they more-usually employed when the project includes an extensive design stage, and the meta-class integral to some hierarchy of entities? Previous Friday Fink

Re: why sqrt is not a built-in function?

2021-01-15 Thread dn via Python-list
On 16/01/2021 10.49, Michael F. Stemper wrote: ... > Es ist Feierabend You had me there for a moment, because spotting a 'double meaning" (actually triple) my mind succumbing to dissonance, refused to translate (into English), instead latching onto the last two syllables:- At one time, tech-jar

Re: why sqrt is not a built-in function?

2021-01-15 Thread dn via Python-list
On 15/01/2021 06.44, Denys Contant wrote: > I don't understand why sqrt is not a built-in function. > Why do we have to first import the function from the math module? > I use it ALL THE TIME! > > That felt good. Thank you. Are you 'venting', or do you have a specific frustration-induced questi

Re: why sqrt is not a built-in function?

2021-01-15 Thread dn via Python-list
On 16/01/2021 11.40, Michael F. Stemper wrote: > On 15/01/2021 16.01, Chris Angelico wrote: >> On Sat, Jan 16, 2021 at 8:56 AM Michael F. Stemper >> wrote: >>> >>> On 15/01/2021 15.26, Stefan Ram wrote: "Michael F. Stemper" writes: > On 15/01/2021 14.01, Stefan Ram wrote: > >> __imp

Re: open sentinel-2image python

2021-01-17 Thread dn via Python-list
On 18/01/2021 08.12, omid mohammadi wrote: > On Sunday, January 17, 2021 at 9:31:58 PM UTC+3:30, MRAB wrote: >> On 2021-01-17 13:57, Karsten Hilbert wrote: >>> Am Sun, Jan 17, 2021 at 02:20:24AM -0800 schrieb omid mohammadi: >>> When I open the sentinel-2 image in Python, I get the following

IDE tools to debug in Python?

2021-01-27 Thread flaskee via Python-list
While print() is groovy and all, if anyone runs across a non-pdb python debugger (standalone or IDE-based) please let me know. I too was blessed with IDE-based debugging (in the 90's!) * where you can set break point(s); * have the program stop right before a suspected failure point; * check

Re: IDE tools to debug in Python?

2021-01-27 Thread flaskee via Python-list
M Michał Jaworski wrote: > >> PyCharm has all these debugging capabilities and there is a community >> edition that you can use for free. If you earn for the living with Python it >> is worth investing in professional edition though. >> >> Michał Jaworski >&

Re: IDE tools to debug in Python?

2021-01-27 Thread flaskee via Python-list
Thank you J. Pic. Out of everything today, (and given my priority is Python/Flask debugging) it looks like Wing IDE is something to dig into. Thanks Sent with ProtonMail Secure Email. ‐‐‐ Original Message ‐‐‐ On Wednesday, January 27, 2021 4:09 PM, J. Pic wrote: > Thonny, winpdb/win

Re: Response for PING in ircbot.

2021-02-03 Thread dn via Python-list
On 04/02/2021 07.07, Dennis Lee Bieber wrote: > On Tue, 02 Feb 2021 20:26:34 -0500, Random832 > declaimed the following: > > >> 1. It looks like you're forgetting to send \n\r > > Isn't the convention \r\n -- from the days of teletype, when the return > took longer to complete than the

RE: IDE tools to debug in Python?

2021-02-05 Thread flaskee via Python-list
‐‐‐ Original Message ‐‐‐ On Friday, February 5, 2021 5:03 PM, Schachner, Joseph wrote: > capability is PyScripter. > Completely free, downloadable from SourceForge Thank you. I just wanted to add, that it is here as well: https://github.com/pyscripter https://github.com/pyscripter/pys

Re: Selenium finds object that is interactible but says otherwise

2021-02-06 Thread dn via Python-list
On 07/02/2021 08.21, Philipp Daher via Python-list wrote: > Hello, > > > I recently programmed some code for a webdriver with selenium. > I asked the program to find an input tag, which is interactible, with this: >     > searchbar=driver.find_element_by_class_name(&quo

Re: Response for PING in ircbot.

2021-02-07 Thread flaskee via Python-list
‐‐‐ Original Message ‐‐‐ On Saturday, January 30, 2021 11:50 AM, Bischoop wrote: > Got problem with responding for Ping, tried so many ways to response > and always end up with time out or other error. This time: > Is it possible to share your final Ping answer? I've had a long term Fl

Re: Python cannot count apparently

2021-02-07 Thread dn via Python-list
On 08/02/2021 09.49, Kevin M. Wilson via Python-list wrote: > Set i = 0 at the begin of the code, that way each entry starts at Logical 0 > of the array/container/list... FYI: https://docs.python.org/3/library/stdtypes.html#typesseq-range See also @Chris' contribution regarding t

Re: Fwd: Inconveniente

2021-02-09 Thread dn via Python-list
On 09/02/2021 15.13, Juan Jose Reyna Figuera wrote: > *Buenas tardes, le escribo breve y puntualmente para reportar este el > siguiente error al cual no le pude dar solución.* > > *Instalé Python 3.9.1 (64 bits), todo había funcionado bien hasta que > necesité usar la librería seaborn. Al ejecutar

Re: Response for PING in ircbot.

2021-02-09 Thread flaskee via Python-list
‐‐‐ Original Message ‐‐‐ On Saturday, January 30, 2021 11:50 AM, Bischoop wrote: > Got problem with responding for Ping, > tried so many ways to response > and always end up with time out or other error. > This time: > Is it possible to share your final Ping answer with the list? I've

Re: installation issues

2021-02-09 Thread dn via Python-list
On 10/02/2021 12.23, Martin Lopez wrote: > Hello, > > My name is Martin Lopez. I just downloaded Python 3.9.1 (64 bit) Setup. > > After I install the program then try to run it, with no success. > > I've uninstalled all previous versions and reinstalled them, but it does > not seem to help. > >

Re: New Python implementation

2021-02-11 Thread dn via Python-list
On 12/02/2021 07.14, Mr Flibble wrote: > On 11/02/2021 18:06, Chris Angelico wrote: >> On Fri, Feb 12, 2021 at 5:01 AM Mr Flibble >> wrote: >>> >>> On 11/02/2021 16:31, Dan Stromberg wrote: On Thu, Feb 11, 2021 at 4:35 AM Mr Flibble wrote: > I am starting work on creating

Re: New Python implementation

2021-02-11 Thread dn via Python-list
On 12/02/2021 08.53, Chris Angelico wrote: > On Fri, Feb 12, 2021 at 6:47 AM dn via Python-list > wrote: >> 3 >> My mind is whirling in an attempt to understand "show me a better time". >> Does this perhaps indicate that @Chris' social life leaves somet

Re: mutating a deque whilst iterating over it

2021-02-11 Thread dn via Python-list
On 12/02/2021 09.22, duncan smith wrote: > Hello, > It seems that I can mutate a deque while iterating over it if I > assign to an index, but not if I append to it. Is this the intended > behaviour? It seems a bit inconsistent. Cheers. Yes, and no! Agree and disagree. (see how decisive I ca

Re: PSYCOPG2

2021-02-13 Thread dn via Python-list
On 13/02/2021 18.34, Mladen Gogala via Python-list wrote: > On Fri, 12 Feb 2021 18:29:48 +, Tony Ogilvie wrote: > >> I am trying to write a program to open a PostgesSQL 13 database using >> psycopg2. All seems to work if I write direct to Python but if I write >> the

Re: Is email.message.get() case insensitive for the header name?

2021-02-15 Thread dn via Python-list
On 15/02/2021 09.50, Chris Green wrote: > It isn't clear from the documentation. Does email.message.get() care > about the case of the header it's getting? > > I checking mailing list mails and the "List-Id:" header is a bit > 'mixed', i.e. it can be List-Id:, or List-ID: or list-id:, will > email

Re: Mr. Flibble

2021-02-15 Thread dn via Python-list
On 16/02/2021 07.09, Ethan Furman wrote: > Thank you to those who pointed out this individual to the moderators. As > Mr. Flibble accurately noted, he is not on the mailing list -- so his > posts won't be here either. Appreciating the work you(s) invest on my/our behalf! -- Regards, =dn -- https

Re: New Python implementation

2021-02-15 Thread dn via Python-list
On 16/02/2021 17.57, Dan Stromberg wrote: > On Mon, Feb 15, 2021 at 8:52 PM Igor Korot wrote: > >> Hi, guys, >> Let me try to throw in another one - PL/1. >> This guys used to be very popular with the accounting community... >> > > Actually PL/I is basically proprietary Pascal - from IBM. My

Re: use set notation for repr of dict_keys?

2021-02-20 Thread dn via Python-list
On 20/02/2021 20.25, Wolfgang Stöcher wrote: > Having a dict like >   d = {'one': 1, 'two': 2} > the representation of its keys >   repr(d.keys()) > gives >   "dict_keys(['one', 'two'])" > > But since the keys are unique, wouldn't a representation using the set > notation > be more intuitive, i.e.

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-20 Thread dn via Python-list
On 21/02/2021 06.02, jak wrote: > Il 20/02/2021 15:40, C W ha scritto: >> Hello everyone, >> >> I'm curious if there is a way take number and back each digit by 3 ? >> >> 2342 becomes 9019 >> 8475 becomes 5142 >> 5873 becomes 2540 >> >> The tricky part is that 2 becomes 9, not -1. >> >> Here's my t

Re: Deleting Python 3.8.5

2021-02-22 Thread dn via Python-list
On 23/02/2021 08.00, Vinicius Costa Marques wrote: > Hello there Python team, I’m having this problem were I installed Python > 3.9.2 and then went to unistall 3.8.5 but here is the problem the version > 3.8.5 dosen’t get deleted properly. The uninstall program says that > everything worked but

is not recognized as an internal or external command, operable program or batch file.

2021-03-01 Thread singh.veer99999--- via Python-list
Dear Sir/Madam Sir I am facing the issue from 10 days. And I tried all the ways to remove this or to come out of this problem but as i try to install some PYTEST or OPENPYXL packages using pip it gives the notification that there is no writeable path present due to that I am not

Re: Why assert is not a function?

2021-03-02 Thread Mirko via Python-list
Am 02.03.2021 um 23:09 schrieb Stestagg: > Ignoring the question about this feature being particularly useful, it It is useful because "assert" is primarily (if not purely and exclusive) a debugging tool during development and testing. In production code you don't want any asserts, but logging. H

Re: program python

2021-03-04 Thread dn via Python-list
Hi, and welcome to the list. On 05/03/2021 09.36, alberto wrote: > Hi I'm tring to write a program with python to evaluate data of csv data > In particular I would extract this information > > View data on the presence of men and women in Affori over time. > > * Carry out an analysis relating t

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Mirko via Python-list
Am 06.03.2021 um 22:24 schrieb Ben Bacarisse: > Mr Flibble writes: > >>> Someone who says that he is capable of writing a compiler that >>> translates every language has megalomania. No one can do this. >> >> Just because you can't make one it doesn't follow that nobody else >> can. > > True, bu

Re: Apriori Algorithm

2021-03-07 Thread dn via Python-list
On 07/03/2021 20.56, sarang shah wrote: > I have this dataset in a text file I need to make an apriori algorithm based > on it. Please help. > > 25 52 164 240 274 328 368 448 538 561 630 687 730 775 825 834 > 39 120 124 205 401 581 704 814 825 834 > 35 249 674 712 733 759 854 950 > 39 422 449

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-08 Thread Mirko via Python-list
Am 07.03.2021 um 21:52 schrieb Avi Gross via Python-list: > The precedence example used below made a strange assumption that the > imaginary program would not be told up-front what computer language it was > being asked to convert from. That is not the scenario being discussed as

Re: Found a problem

2021-03-09 Thread dn via Python-list
On 10/03/2021 09.16, Victor Dib wrote: > Olá, comunidade do Python! Olá Victor! At which point we should switch to English, because this is an English-language list. (there may be Portuguese lists - I haven't looked) Please do not be afraid to write in English. There are many here who are quite

Re: Please don't feed the trolls

2021-03-09 Thread dn via Python-list
On 10/03/2021 13.47, Dennis Lee Bieber wrote: > On Tue, 9 Mar 2021 16:57:52 -0600, Sam declaimed the > following: > >> On 3/8/21 3:35 PM, Chris Angelico wrote: >>> On Tue, Mar 9, 2021 at 8:31 AM D'Arcy Cain wrote: On 2021-03-06 4:24 p.m., Terry Reedy wrote: > Trolling, among other

Re: Why assert is not a function?

2021-03-11 Thread dn via Python-list
On 12/03/2021 10.26, Cameron Simpson wrote: > On 12Mar2021 05:31, Chris Angelico wrote: >> On Fri, Mar 12, 2021 at 3:37 AM Serhiy Storchaka wrote: >>> assert(expensive_computation()) >> >> Do you have any asserts like that, or is that a purely theoretical >> complaint? I have never once seen anyt

Friday Finking: following, weirdness with list()

2021-03-11 Thread dn via Python-list
The in-person version of 'Friday Finking' has been set-aside by COVID-precautions. Here's hoping the questions asked below will stimulate some thinking, or mild entertainment... On 02/03/2021 03.10, Grant Edwards wrote: > On 2021-03-01, Greg Ewing wrote: >> On 28/02/21 1:17 pm, Cameron Simpson w

Re: Why assert is not a function?

2021-03-11 Thread dn via Python-list
On 12/03/2021 11.27, Chris Angelico wrote: > On Fri, Mar 12, 2021 at 9:10 AM Ethan Furman wrote: >> >> On 3/11/21 1:45 PM, dn via Python-list wrote: >> >>> Is assert so much faster/cheaper than try...except...raise? >> >> Infinitely faster when they ar

Re: file location/directory

2021-03-14 Thread dn via Python-list
On 15/03/2021 07.44, Quentin Bock wrote: > how can I change the path that python takes to run certain files, I'm > starting to create game and I want those in separate folders, so how can I > change it so that python runs the program with the files from that folder? Perhaps I'm confused: a) are w

Re: file location/directory

2021-03-16 Thread dn via Python-list
On 17/03/2021 02.02, Gys wrote: > On 3/14/21 7:44 PM, Quentin Bock wrote: >> how can I change the path that python takes to run certain files, I'm >> starting to create game and I want those in separate folders, so how >> can I >> change it so that python runs the program with the files from that >

Re: .title() - annoying mistake

2021-03-19 Thread dn via Python-list
On 20/03/2021 07.49, Grant Edwards wrote: > On 2021-03-19, MRAB wrote: >> You want English "man's" to become "Man's", but French "l'homme" to >> become "L'Homme". It's language-dependant. > > In English, certain words are not capitalized in titles unless they're > the first word in the title (sh

Re: .title() - annoying mistake

2021-03-19 Thread dn via Python-list
On 20/03/2021 06.17, Chris Angelico wrote: > On Sat, Mar 20, 2021 at 4:01 AM Abdur-Rahmaan Janhangeer > wrote: >> >> It's about unnecessary capitalisation for a common use case >> in English. >> >> You can see it in action on my site: >> https://www.compileralchemy.com/#articles >> >> see 24. >> >

Re: .title() - annoying mistake

2021-03-22 Thread dn via Python-list
On 23/03/2021 10.00, Avi Gross via Python-list wrote: > Speaking for myself, I am beyond tired of this topic, however informative > parts have been. +1 > I will say it is irrational to try to impose rationally across all possible > languages, let alone people like me who often combi

Re: Code Formatter Questions

2021-03-28 Thread dn via Python-list
On 29/03/2021 04.42, Travis Griggs wrote: > I've been looking into using a code formatter as a code base size has grown > as well as contributing developers. I've found and played with autopep, > black, and yapf. As well as whatever pycharm has (which may just be gui > preferences around one of

Re: Code Formatter Questions

2021-03-29 Thread dn via Python-list
On 29/03/2021 23.15, Matt Wheeler wrote: >> On 29 Mar 2021, at 04:45, Cameron Simpson wrote: >> >> yapf has many tunings. Worth a look. It is my preferred formatter. By >> comparison, black is both opinionated and has basicly no tuning, >> something I greatly dislike. > > This is not a mark or

Re: Canonical conversion of dict of dicts to list of dicts

2021-03-30 Thread dn via Python-list
On 31/03/2021 01.22, Loris Bennett wrote: > Jon Ribbens writes: >> On 2021-03-30, Loris Bennett wrote: >>> If I have dict of dicts, say >>> >>> dod = { >>> "alice": >>> { >>> "lang": "python", >>> "level": "expert" >>> }, >>> "bob": >>> { >>>

Re: Canonical conversion of dict of dicts to list of dicts

2021-03-30 Thread dn via Python-list
On 31/03/2021 19.24, Loris Bennett wrote: > dn writes: > >> On 31/03/2021 01.22, Loris Bennett wrote: >>> Jon Ribbens writes: On 2021-03-30, Loris Bennett wrote: > If I have dict of dicts, say > > dod = { > "alice": > { > "lang": "python", >>

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-03-31 Thread dn via Python-list
On 01/04/2021 12.14, Chris Angelico wrote: > I think this code makes some sort of argument in the debate about > whether Python has too much flexibility or if it's the best > metaprogramming toolset in the world. I'm not sure which side of the > debate it falls on, though. > > class Building: >

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-03-31 Thread dn via Python-list
On 01/04/2021 13.54, Chris Angelico wrote: > On Thu, Apr 1, 2021 at 11:39 AM dn via Python-list > wrote: >> >> On 01/04/2021 12.14, Chris Angelico wrote: >>> I think this code makes some sort of argument in the debate about >>> whether Python has too

Re: XanaNews Statistic for comp.lang.python. 4/1/2021 5:52:47 AM

2021-04-01 Thread dn via Python-list
On 02/04/2021 01.19, Chris Angelico wrote: > On Thu, Apr 1, 2021 at 10:56 PM The Doctor via Python-list > wrote: >> Top Posters >> >> Ranking Articles NameMost Used Newsreader >> --- -- ---

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-01 Thread dn via Python-list
On 02/04/2021 10.13, Chris Angelico wrote: > On Fri, Apr 2, 2021 at 7:52 AM David L Neil via Python-list > wrote: >> Officially April-Fools Day is over (here), but... > This wasn't a prank post, although it was intended to give amusement > rather than real education or

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread dn via Python-list
On 02/04/2021 21.32, Alan Gauld via Python-list wrote: > On 02/04/2021 00:42, dn via Python-list wrote: > >> Contrarily "tuck" in (old) English slang represented "sweets" (or > > Not that old. We still use it occasionally today. And we > certainly had

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread dn via Python-list
On 02/04/2021 13.00, Chris Angelico wrote: > On Fri, Apr 2, 2021 at 10:43 AM dn via Python-list > wrote: >> >> On 02/04/2021 10.13, Chris Angelico wrote: >>> Well, it's a simple matter of chronology. First you have crude oil, >>> then time passes, and th

Friday Finking: initialising values and implied tuples

2021-04-02 Thread dn via Python-list
When there are several items to be defined and initialised, how do you prefer to format the code, and why? Apprentice: learn options Journeyman: consider and discuss Python Master: define, declare, and correct/advise/tutor Some do not realise that using a tuple is a convenient way to convey mul

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread dn via Python-list
On 03/04/2021 18.45, Greg Ewing wrote: > On 3/04/21 10:36 am, Chris Angelico wrote: >> It means exactly what you'd expect. The tricky part comes when you try >> to knife the block of chocolate, and it makes for a hilarious party >> game. > > A guillotine could be useful in the case of Whittaker's.

Re: Friday Finking: initialising values and implied tuples

2021-04-04 Thread dn via Python-list
On 03/04/2021 11.25, Marco Ippolito wrote: >> (a) basic linear presentation: >> >> resource = "Oil" >> time = 1 >> crude = 2 >> residue = 3 >> my_list = "long" >> >> (b) using explicit tuples: >> >> ( resource, time, crude, residue, my_list ) = ( "Oil", 1, 2, 3, "long" ) >> >> (c) linear and indent

Re: Friday Finking: initialising values and implied tuples

2021-04-04 Thread dn via Python-list
On 04/04/2021 01.00, Rob Cliffe via Python-list wrote: > > > On 03/04/2021 04:09, [email protected] wrote: >> On 2021-04-03 at 02:41:59 +0100, >> Rob Cliffe via Python-list wrote: >> >>> x1 = 42; y1 =  3;  z1 = 10 >>> x

Re: HELP Please, Python Program Help

2021-04-10 Thread dn via Python-list
On 10/04/2021 22.57, Joseph Roffey wrote: > Hi, Im looking for some help with my program, I have been set a task to make > a Strain Calculator. I need it to input two numbers, choosing either Metres > or Inches for the 'Change in Length' divided by the 'Original Length' which > can also be in Me

Re: Ann: New Python curses book

2021-04-10 Thread Russell via Python-list
re, so the > shipping cost by far outweighs the book???s cost. Hope for other???s sake, > it migrates to the other Amazon stores fairly quickly. > > Thanks, > Bill > >> On Mar 30, 2021, at 7:12 AM, Alan Gauld via Python-list >> wrote: >> >> I&#x

Re: all versions of python fail to indent after conditional statement

2021-04-10 Thread Russell via Python-list
I would recommend reading a book that introduces and explains Python rather than just diving in. I'm been enjoying "Introducing Python: Modern Computing in Simple Packages" which can be found at https://amzn.com/1492051365. It started from the beginning and would answer the questions/difficulties y

Re: Style qeustion: Multiple return values

2021-04-12 Thread dn via Python-list
On 12/04/2021 20.29, Steve Keller wrote: > Just a short style question: When returning multiple return values, do > you use parenthesis? > > E.g. would you write > > def foo(): > return 1, 2 > > a, b = foo() > > or do you prefer > > def foo(): > return (1, 2) > >

Re: Style qeustion: Multiple return values

2021-04-12 Thread dn via Python-list
On 12/04/2021 22.32, Chris Angelico wrote: > On Mon, Apr 12, 2021 at 8:20 PM dn via Python-list > wrote: >> >> On 12/04/2021 20.29, Steve Keller wrote: >>> Just a short style question: When returning multiple return values, do >>> you use parenthesis? >>

Re: UI design: combobox or radiobuttons?

2021-04-13 Thread Mirko via Python-list
Am 13.04.2021 um 23:53 schrieb Rich Shepard: > My applications use environmental data, each of which has to specify > the > units (e.g., cm, m, km, ft, yd, mi). With the widget sets I've used > (wxPython and TKinter) I've always used a combobox with the acceptable > choices in it. I'm now planning

Re: [ANN] Free Python tutorial with exercises, cscx.org

2021-04-13 Thread Russell via Python-list
Jach Feng wrote: > Is there any reason a student/beginner learn Python now start from Python2? > > --Jach Only if you want a job porting python2 to python3. Python 2.x is officially End Of Life. -- rust 0x68caecc97f6a90122e51c0692c88d9cb6b58a3dc -- https://mail.python.org/mailman/listinfo/p

Re: need help with a translation issue

2021-04-17 Thread dn via Python-list
On 18/04/2021 10.56, Quentin Bock wrote: > I'm trying to take the user input and let them change the target language > or dest > code: > ... > language_list = googletrans.LANGUAGES > print(language_list) ... > user_choice = input ("Enter a language (the abbreviation or correctly > spelled na

Re: need help with a translation issue

2021-04-17 Thread dn via Python-list
Longer response: NB I've not used the system and only quickly reviewed https://py-googletrans.readthedocs.io/_/downloads/en/documentation/pdf/ NBB I am treating you (and/or other interested-readers) as something of a 'beginner'. No insult is intended should I appear to be 'talking down'. On 18

Re: Comparing text strings

2021-04-18 Thread dn via Python-list
On 14/04/2021 04.05, Mats Wichmann wrote: > On 4/12/21 5:11 PM, Rich Shepard wrote: >> I'm running Slackware64-14.2 and keep a list of installed packages. >> When a >> package is upgraded I want to remove the earlier version, and I've not >> before written a script like this. Could there be a modul

Re: Determine what the calling program is

2021-04-18 Thread dn via Python-list
On 19/04/2021 01.46, Jason Friedman wrote: > I should state at the start that I have a solution to my problem. I am > writing to see if there is a better solution. > > I have a program that runs via crontab every five minutes. It polls a > Box.com folder for files and, if any are found, it copies

Re: do ya still use python?

2021-04-20 Thread dn via Python-list
On 20/04/2021 20.32, Alan Gauld via Python-list wrote: > On 20/04/2021 04:47, Dan Stromberg wrote: > >> Actually, this list is less busy than it was a decade or two ago, but >> that's probably because of things like stackoverflow, python-dev, pypy-dev, >> cython-devel

Re: Ad-hoc SQL query builder for Python3?

2021-04-24 Thread dn via Python-list
On 25/04/2021 02.24, Rich Shepard wrote: > My web searches are not finding what I need to include in an application > I'm > building: an ad-hoc sql query builder. > > End users will want to query their data for reports not included in the > built-in queries. My searches find a windows-only tool th

Re: Ad-hoc SQL query builder for Python3?

2021-04-25 Thread dn via Python-list
This message is not meant as a personal attack. The intention is to offer criticism of the way a vague question and its apparently non-specific replies, have produced less than satisfying 'results' - for everyone. A broad question can be good. I ask them too(!) 'Good', in the sense that its open

Re: Start Python programming

2021-04-27 Thread dn via Python-list
On 28/04/2021 05.32, Gazoo wrote: > > > I'd like to start learning Python programming. What sites/tutorials > could you recommend for beginner, please. Start with the Python Tutorial (https://docs.python.org/3/tutorial/index.html), thereafter there are other 'docs' at the same site. There are

Re: text displays on screen only when I click to exit the program

2021-04-30 Thread Mirko via Python-list
Am 30.04.2021 um 20:55 schrieb Quentin Bock: > code with comments for context: > > #Create a text based game where the user must find 3 items before > completing a level > #imports and variables for game > import pygame > from pygame import mixer > running = True > #initializes pygame > pygame.ini

Re: Start Python programming

2021-04-30 Thread Russell via Python-list
Gazoo wrote: > > > I'd like to start learning Python programming. What sites/tutorials > could you recommend for beginner, please. > I liked the book found at https://automatetheboringstuff.com/ You can read the whole book online. I think you used to be able to download a copy too. It has lot

OT: Autism in discussion groups (was: Re: Proposal: Disconnect comp.lang.python from python-list)

2021-05-08 Thread Mirko via Python-list
I apologize for this OT post, especially because it's in reply to an at least partly troll post, but I just can't resist. Sorry. Am 08.05.2021 um 14:09 schrieb Talkie Toaster: > On 06/05/2021 18:56, Mark Lawrence wrote: >> Quite frankly I don't care how this discussion goes as the Python >> co

Re: OT: Autism in discussion groups (was: Re: Proposal: Disconnect comp.lang.python from python-list)

2021-05-09 Thread dn via Python-list
On 09/05/2021 20.31, Abdur-Rahmaan Janhangeer wrote: > On Sun, May 9, 2021 at 5:29 AM Chris Angelico wrote: > >> >> Probably the same reason it has never worked. The only thing that's >> changed is the social acceptability of vilifying those you don't like. >> Once upon a time, there were those i

Re: OT: Autism in discussion groups

2021-05-10 Thread Mirko via Python-list
Am 09.05.2021 um 02:34 schrieb Michael Torrie: > On 5/8/21 3:28 PM, Mirko via Python-list wrote: >> >> I apologize for this OT post, especially because it's in reply to an >> at least partly troll post, but I just can't resist. Sorry. >> >> P.S.:

Re: The importance of mental health

2021-05-10 Thread Mirko via Python-list
Am 10.05.2021 um 15:16 schrieb Kyle Stanley: > Hey all, > > In these last few months, I have been in the process of healing from some > pretty heavy past trauma. And now that I am on the road to recovery, I want > to share my journey with the Python community in hopes that it may reach > those tha

Re: Python script accessing own source code

2021-05-12 Thread Mirko via Python-list
Am 12.05.2021 um 20:41 schrieb Robin Becker: > ... >> >> with open(__file__) as myself: >> print(myself.read(), end='') > > very nice, but accessing code that's already seems quite easy. I > think the real problem is to get a python script name that creates > and writes itself. So I would

Python install failing. Install log is available.

2021-05-20 Thread jan via Python-list
Hi, I've usually had problems installing python, typically pip breaking. This time it's simply not installing correctly when run as administrator, and not at all when run as non-administrator. As administrator, it's not installing for other users as I believe it should. It's certainly not addin

Re: Python install failing. Install log is available.

2021-05-21 Thread jan via Python-list
/20/2021 7:06 AM, jan via Python-list wrote: > >> This time it's simply not installing correctly when run as >> administrator, and not at all when run as non-administrator. >> >> As administrator, it's not installing for other users as I believe it >> shou

<    1   2   3   4   5   6   7   8   9   10   >