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

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: 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: 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 combine 3 or more

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 >> --- -- >> 1 167 Tes

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 debate or anything. So there

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 >>> x2 = 41; y2 = 12; z2 = 9 >>> x3 =  8;  y3 =  8

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: 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: 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, python-ideas, distutils-sig,

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: 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: Data structure for plotting monotonically expanding data set

2021-05-27 Thread dn via Python-list
On 27/05/2021 21.28, Loris Bennett wrote: > Hi, > > I currently a have around 3 years' worth of files like > > home.20210527 > home.20210526 > home.20210525 > ... > > so around 1000 files, each of which contains information about data > usage in lines like > > namekb > alice 1

Re: Applying winpdb_reborn

2021-05-29 Thread dn via Python-list
On 30/05/2021 11.52, Rich Shepard wrote: > On Sun, 30 May 2021, Chris Angelico wrote: > Please excuse my long-winded description of a FORTRAN IV bug in an lake > ecosystem energy model I wrote at the University of Illinois in the early > 1970s. It is an example of what you wrote above. > > The pr

Re: Definition of "property"

2021-05-30 Thread dn via Python-list
On 31/05/2021 04.57, Irv Kalb wrote: > I am doing some writing (for an upcoming book on OOP), and I'm a little > stuck. > > I understand what a "property" is, how it is used and the benefits, but > apparently my explanation hasn't made the light bulb go on for my editor. > The editor is aski

Re: Posting code on stackoverflow

2021-06-06 Thread dn via Python-list
On 06/06/2021 13.56, Terry Reedy wrote: > On 6/5/2021 5:36 PM, Rich Shepard wrote: >> I tried to post a question on stackoverflow.com which included a bunch of >> code (entered after clicking the box 'code'). I noticed that lines were >> wrapped but could not find how to expand the input box so the

Terminology: EU language skills, and Master to Main (or ...)

2021-06-12 Thread dn via Python-list
[to folk subscribed to both the Python list and Python-Tutor: apologies for cross-posting] Regarding levels of skill or complexity in learning, the European Union has been working on "The Common European Framework of Reference for Languages: Learning, Teaching, Assessment". It also standardises t

Re: Where did the message go?

2021-06-14 Thread dn via Python-list
On 15/06/2021 01.00, Grimble wrote: > I have two machines running Mageia 8 and Python 2.8.9, They use the same > Python script to maintain a list of changed packages from dnf update and > dnf install. In addition the script sends a short email message to my > main email address. The problem is: the

Re: Php vs Python gui (tkinter...) for small remote database app

2021-06-14 Thread dn via Python-list
On 15/06/2021 07.17, Pascal B via Python-list wrote: > Hi, > I would like to know if for a small app for instance that requires a > connection to a remote server database if php is more suitable than Python > mainly regarding security. > Php requires one port for http and one port for the connect

Re: Behaviour of pop() for dictionaries

2021-06-14 Thread dn via Python-list
On 15/06/2021 09.18, BlindAnagram wrote: > On 14/06/2021 20:43, Chris Angelico wrote: >> On Tue, Jun 15, 2021 at 5:41 AM BlindAnagram ... > No it isn't hard to use popitem() but it evidently proved hard for me to > remember that it was there. If that's a problem, you're going to love using deques

Re: Where did the message go?

2021-06-15 Thread dn via Python-list
On 16/06/2021 04.47, Chris Angelico wrote: > On Wed, Jun 16, 2021 at 2:41 AM Grimble wrote: >> Thanks for reminding me of the log files. I've worked out that the >> message on machine H (for haydn, which shows my preferred music genre) >> was bouncing because haydn.. was not a registered

Re: Behaviour of pop() for dictionaries

2021-06-15 Thread dn via Python-list
On 15/06/2021 21.37, BlindAnagram wrote: > On 15/06/2021 00:11, dn wrote: >> On 15/06/2021 09.18, BlindAnagram wrote: >>> On 14/06/2021 20:43, Chris Angelico wrote: On Tue, Jun 15, 2021 at 5:41 AM BlindAnagram >> ... > I think the difference here is that I know I am going to have to look at >

Re: tkinter: tksheet

2021-06-16 Thread dn via Python-list
On 17/06/2021 08.45, Rich Shepard wrote: > On Wed, 16 Jun 2021, Terry Reedy wrote: > >> Somewhat sparse doc at >> https://github.com/ragardner/tksheet/blob/master/DOCUMENTATION.md#5-modifying-table-data >> >> insert_row() > > Terry, > > I'm reading this now and saw that. > >> and change the col

Re: a simple question

2021-07-26 Thread dn via Python-list
On 27/07/2021 10.19, Glenn Wilson via Python-list wrote: > I recently downloaded the latest version of python, 3.9.6. Everything works > except, the turtle module. I get an error message every time , I use basic > commands like forward, backward, right and left. My syntax is correct: > pat.forwa

Re: SQLALchemy: update with in clause from kwargs

2021-08-03 Thread dn via Python-list
On 04/08/2021 13.08, Larry Martell wrote: > I am trying to write a function that takes kwargs as a param and > generates an update statement where the rows to be updated are > specified in an in clause. > > Something like this: > > def update_by_in(self, **kwargs): > filter_group = []

Re: Errors and some bugs

2021-08-09 Thread dn via Python-list
On 09/08/2021 15.12, Himanshu Gupta wrote: > While running some pip command to install spacy package for ver3.9 I always > face trouble can you provide a solution The short answer is "yes", but what is the problem? Please copy-paste the install command and the (full) error message, from the termi

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-10 Thread dn via Python-list
Apologies for lateness. Coincidentally, I've been asked to speak to our local Python Users' Group on slicing. Herewith an attempt to modify those demos around your data/question. Apologies if the result is thus somewhat lacking in flow. Also, whereas I prefer to illustrate 'how it works', I percei

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-11 Thread dn via Python-list
On 12/08/2021 02.59, Jack Brandom wrote: > dn writes: > ... >> Also, whereas I prefer to illustrate 'how it works', I perceive that you >> are used to learning 'rules' and only thereafter their application (the >> teaching-practice under which most of us learned) - so, another reason >> for mixi

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-11 Thread dn via Python-list
On 12/08/2021 10.32, Dennis Lee Bieber wrote: > On Wed, 11 Aug 2021 11:59:11 -0300, Jack Brandom > declaimed the following: >> Where are these production rules coming from? They're not at >> https://docs.python.org/3/reference/grammar.html >> The word ``stride'' doesn't appear in this grammar.

Re: on writing a while loop for rolling two dice

2021-08-28 Thread dn via Python-list
On 29/08/2021 08.46, Hope Rouselle wrote: > Here's my solution: > > --8<---cut here---start->8--- > def how_many_times(): > x, y = 0, 1 > c = 0 > while x != y: > c = c + 1 > x, y = roll() > return c, (x, y) > > Why am I unhappy? I'm wish I cou

Re: on writing a while loop for rolling two dice

2021-08-29 Thread dn via Python-list
On 29/08/2021 20.06, Peter Otten wrote: ... > OK, maybe a bit complicated... but does it pay off if you want to > generalize? > def roll_die(faces): > while True: yield random.randrange(1, 1 + faces) > def hmt(faces, dies): > for c, d in enumerate(zip(*[roll_die(faces)]*dies), 1

Re: on writing a while loop for rolling two dice

2021-08-29 Thread dn via Python-list
On 29/08/2021 22.24, Chris Angelico wrote: > On Sun, Aug 29, 2021 at 8:14 PM dn via Python-list > wrote: >> Efficiency: >> - wonder how max( d ) == min( d ) compares for speed with the set() type >> constructor? > > That may or may not be an improvement. > >&

Re: on writing a while loop for rolling two dice

2021-08-29 Thread dn via Python-list
On 30/08/2021 00.47, Peter Otten wrote: > On 29/08/2021 12:13, dn via Python-list wrote: >> On 29/08/2021 20.06, Peter Otten wrote: >> ... >>> OK, maybe a bit complicated... but does it pay off if you want to >>> generalize? >>> >>>

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-30 Thread dn via Python-list
On 31/08/2021 11.07, Dennis Lee Bieber wrote: > On Sun, 29 Aug 2021 19:49:19 -0700 (PDT), "[email protected]" > declaimed the following: ... > Might have helped to mention you were in China... To me, CST is North > America Central Standard Time (and I'd have expected this time of year to >

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread dn via Python-list
On 01/09/2021 00.45, Chris Angelico wrote: > On Tue, Aug 31, 2021 at 8:55 PM MRAB wrote: >> On 2021-08-31 02:16, dn via Python-list wrote: >>> On 31/08/2021 11.07, Dennis Lee Bieber wrote: >>>> On Sun, 29 Aug 2021 19:49:19 -0700 (PDT), "hongy...@gmail

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread dn via Python-list
On 01/09/2021 09.13, Chris Angelico wrote: > On Wed, Sep 1, 2021 at 6:38 AM dn via Python-list > wrote: >>> Yeah. I do recommend making good use of the IANA tzinfo database >>> though (especially since Python 3.9 made that a bit easier to access), >>> as it'

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread dn via Python-list
> Yeah. And if you think you've heard it all, sign up for the > tzdata-announce mailing list and wait for the next phenomenon. I think > Egypt (Africa/Cairo) is currently in the lead for weirdest timezone > change, for (with short notice) announcing that they'd have DST during > summer but not duri

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread dn via Python-list
On 01/09/2021 11.27, MRAB wrote: > On 2021-08-31 23:31, Chris Angelico wrote: >> On Wed, Sep 1, 2021 at 8:22 AM MRAB wrote: >>> >>> [snip] >>> In the EU, DST in the member states changes at the same time. It's not >>> like the US where it ripples across the timezones, so the differences >>> vary d

Re: Problem with python

2021-09-04 Thread dn via Python-list
On 05/09/2021 06.27, Igor Korot wrote: > Hi, ALL, > > [code] > igor@WaylandGnome ~/bakefile $ python > Python 3.9.6 (default, Aug 8 2021, 17:26:32) > [GCC 10.3.0] on linux > Type "help", "copyright", "credits" or "license" for more information. from distutils import sysconfig print sysc

Friday Finking: Contorted loops

2021-09-09 Thread dn via Python-list
Why does Python not have a repeat-until loop construct? (or should that be 'modern programming languages'?) This is a perennial question (one contributor calling it "immemorial"), but there seem to be reasons why the Python Interpreter would find such a construct awkward, or is otherwise unable to

Re: on writing a while loop for rolling two dice

2021-09-10 Thread dn via Python-list
On 31/08/2021 01.50, Chris Angelico wrote: > On Mon, Aug 30, 2021 at 11:13 PM David Raymond > wrote: >> >>> def how_many_times(): >>> x, y = 0, 1 >>> c = 0 >>> while x != y: >>> c = c + 1 >>> x, y = roll() >>> return c, (x, y) >> >> Since I haven't seen it used in answers yet, her

Re: on writing a while loop for rolling two dice

2021-09-11 Thread dn via Python-list
On 11/09/2021 18.03, Chris Angelico wrote: > On Sat, Sep 11, 2021 at 3:26 PM dn via Python-list > wrote: >> >> On 31/08/2021 01.50, Chris Angelico wrote: >>> On Mon, Aug 30, 2021 at 11:13 PM David Raymond >>> wrote: >>>> >>>&

Re: The code version of python -i

2021-09-16 Thread dn via Python-list
Abdur-Rahmaan, Apologies for delay: several last-minute tasks were landed on me, so I haven't been able to 'read the list' since last week. > If i have a file name flower.py and i add x = 1 in it. > When i run python -i flower.py i get a shell > > If type x i get 1 x > 1 > > The value

Re: Question again

2021-09-16 Thread dn via Python-list
On 17/09/2021 12.25, Avi Gross via Python-list wrote: > I wonder if this is yet another case when a pop-up window closes rapidly > when done and any last text written is just not perceived. > > Good design in such cases makes a final pause till the user acknowledges in > some way that they are don

Re: XML Considered Harmful

2021-09-23 Thread dn via Python-list
On 22/09/2021 07.22, Michael F. Stemper wrote: > On 21/09/2021 13.49, alister wrote: >> On Tue, 21 Sep 2021 13:12:10 -0500, Michael F. Stemper wrote: >> >>> On the prolog thread, somebody posted a link to: >>> Given the source, shouldn't one

Re: XML Considered Harmful

2021-09-23 Thread dn via Python-list
On 24/09/2021 14.07, Stefan Ram wrote: > dn writes: >> With that, why not code it as Python expressions, and include the module? > > This might create a code execution vulnerability if such > files are exchanged between multiple parties. The OP's spec, as quoted earlier(!), reads: "It's m

Re: XML Considered Harmful

2021-09-24 Thread dn via Python-list
On 25/09/2021 06.59, Peter J. Holzer wrote: > There are a gazillion formats and depending on your needs one of them > might be perfect. Or you may have to define you own bespoke format (I > mean, nobody (except Matt Parker) tries to represent images or videos as > CSVs: There's PNG and JPEG and WEB

Re: XML Considered Harmful

2021-09-25 Thread dn via Python-list
On 26/09/2021 10.07, Stefan Ram wrote: > "Michael F. Stemper" writes: >> fitting hierarchical >> data into rows/columns just seems wrong > > There were hierarchical database management systems like > IMS by IBM based on that point of view. Today, almo

Re: XML Considered Harmful

2021-09-25 Thread dn via Python-list
On 26/09/2021 10.48, [email protected] wrote: > On 2021-09-25 at 15:20:19 -0500, > "Michael F. Stemper" wrote: > >> ... For instance, if >> I modeled a fuel like this: >> >> >> ton >> 21.96 >> 18.2 >> ... > Disclaimer: I am not a big XML fan, for a number of

Re: Posts from gmane no longer allowed?

2021-09-26 Thread dn via Python-list
On 27/09/2021 06.34, Grant Edwards wrote: > On 2021-09-26, Ethan Furman wrote: >> On 9/26/21 9:21 AM, Grant Edwards wrote: >>> On 2021-09-26, Chris Angelico wrote: >> I'm not sure whether the policy change happened on python-list, or at gmane. From the look of the error message you got,

Re: XML Considered Harmful

2021-09-28 Thread dn via Python-list
On 25/09/2021 11.26, David L Neil via Python-list wrote: > On 25/09/2021 11.00, Chris Angelico wrote: > >> Invented because there weren't enough markup languages, so we needed another? > > Anything You Can Do I Can Do Better > https://www.youtube.com/watch?v=_UB1YAsPD6U Article (rather brief) i

OT: AttributeError

2021-09-28 Thread dn via Python-list
On 29/09/2021 10.50, Stefan Ram wrote: > (For Python programmers who have watched "Game of Thrones".) > > |>>> class girl: > |... pass > |... > |>>> girl = girl() > |>>> print( girl.name ) > |Traceback (most recent call last): > | File "", line 1, in > |AttributeError: A girl has no name.

Re: XML Considered Harmful

2021-09-28 Thread dn via Python-list
On 29/09/2021 06.53, Michael F. Stemper wrote: > On 28/09/2021 10.53, Stefan Ram wrote: >> "Michael F. Stemper" writes: >>> Well, I could continue to hard-code the data into one of the test >>> programs >> >>    One can employ a gradual path from a program with hardcoded >>    data to an entity sh

Re: OT: AttributeError

2021-09-28 Thread dn via Python-list
On 29/09/2021 12.21, Chris Angelico wrote: > On Wed, Sep 29, 2021 at 9:10 AM <[email protected]> wrote: >> >> On 2021-09-29 at 11:38:22 +1300, >> dn via Python-list wrote: >> >>> For those of us who remember/can compute in binary, octal,

Re: OT: AttributeError

2021-09-29 Thread dn via Python-list
On 29/09/2021 19.16, Greg Ewing wrote: > On 29/09/21 3:03 pm, [email protected] wrote: >> Who thinks in little >> endian?  (I was raised on 6502s and 680XX CPUs; 8080s and Z80s always >> did things backwards.) > > The first CPU I wrote code for was a National SC/MP, which doesn't

Re: Definitive guide for Regex

2021-09-30 Thread dn via Python-list
On 01/10/2021 06.16, Barry Scott wrote: > > >> On 30 Sep 2021, at 12:29, Shaozhong SHI wrote: >> >> Dear All, >> >> I am trying to look for a definitive guide for Regex in Python. >> Can anyone help? > > Have you read the python docs for the re module? I learned from Jeffrey Friedl's book "Ma

Re: How to pass a method as argument?

2021-09-30 Thread dn via Python-list
On 30/09/2021 18.11, Anil Anvesh wrote: > I want to write a python calculator program that has different methods to > add, subtract, multiply which takes 2 parameters. I need to have an execute > method when passed with 3 parameters, should call respective method and > perform the operation. How

Re: Understanding the working mechanis of python unary arithmetic operators.

2021-10-05 Thread dn via Python-list
On 06/10/2021 10.10, Chris Angelico wrote: > On Wed, Oct 6, 2021 at 7:52 AM [email protected] > wrote: >> >> On Saturday, October 2, 2021 at 4:59:54 PM UTC+8, [email protected] wrote: This thread seems to have been very one-sided. Either I've forgotten selective use of the DEL-key, or the abo

Re: Selenium py3.8+ DepreciationWarnings - where to find doc to update code?

2021-10-16 Thread dn via Python-list
The issues illustrated likely have less to do with Python than with Selenium (or even Firefox - depending how far back we need to go). That and our fate with the many web-search engines prioritising 'authoritative sources' in their results. Such definition includes 'clicks' over time. It fails to

Re: New assignmens ...

2021-10-22 Thread dn via Python-list
On 23/10/2021 08.34, Chris Angelico wrote: > On Sat, Oct 23, 2021 at 6:24 AM Jon Ribbens via Python-list > wrote: >> >> On 2021-10-22, Stefan Ram wrote: >>> Paulo da Silva writes: Why doesn't this work if (self.ctr:=self.ctr-1)<=0: while this works if (ctr:=ctr-1)<=

Re: New assignmens ...

2021-10-22 Thread dn via Python-list
With apologies for pressing Send too early... On 23/10/2021 08.41, dn via Python-list wrote: > On 23/10/2021 08.34, Chris Angelico wrote: >> On Sat, Oct 23, 2021 at 6:24 AM Jon Ribbens via Python-list >> wrote: >>> >>> On 2021-10-22, Stefan Ram wrote: >&

Re: New assignmens ...

2021-10-22 Thread dn via Python-list
On 23/10/2021 12.51, Greg Ewing wrote: > On 23/10/21 8:49 am, dn wrote: >> Whereas, creating a list (or tuple...) is legal because the structure's >> name is an "identifier"! > > No, the restriction only applies to the LHS. The list construction > is on the RHS. That contention (above) may have

Re: New assignmens ...

2021-10-25 Thread dn via Python-list
On 26/10/2021 10.45, Chris Angelico wrote: > On Tue, Oct 26, 2021 at 8:42 AM Avi Gross via Python-list > wrote: >> Personally, I don't care what is done and suspect I will rarely feel much >> need to use the current walrus operator, let alone an enhanced Odobenus >> rosmarus operator like ::== ...

The task is to invent names for things

2021-10-26 Thread dn via Python-list
Some time ago I watched a video of a Raymond Hettinger talk. In it he recounted answering his son's question of 'what do you do, Dad?' by suggesting that programmers spend much?most of their time thinking of names - and good names are better than "n = name", etc. This theme developed throughout the

Re: The task is to invent names for things

2021-10-26 Thread dn via Python-list
On 27/10/2021 11.16, Stefan Ram wrote: > dn writes: >> Some time ago I watched a video of a Raymond Hettinger talk. In it he >> recounted answering his son's question of 'what do you do, Dad?' > > The Mental Game of Python - Raymond Hettinger (PyBay 2019) > > Around minute 21, Raymond says: >

Re: The task is to invent names for things

2021-10-26 Thread dn via Python-list
On 27/10/2021 11.21, Stefan Ram wrote: > [email protected] (Stefan Ram) writes: >> The Mental Game of Python - Raymond Hettinger (PyBay 2019) >> |What daddy does is make new words to make computers easier to use." > > BTW: It now also reminds me of: > > |What I Do > | > |I build paradigms

Re: Create a contact book

2021-10-26 Thread dn via Python-list
On 27/10/2021 04.16, Avi Gross via Python-list wrote: > Chris, > > I think it is time someone set up a business where they do the homework for > people for a mere $1,000 or so per hour. Anonymously, of course. And we can > refer requests for free homework advice there. > > Maybe the answer to thi

Re: New assignmens ...

2021-10-27 Thread dn via Python-list
On 24/10/2021 22.23, O365 Dict wrote: > Well I have the following use case: > > while (temp_result := calculate_next_couple(a, b))[1]: > a, b = temp_result > more calculations > > Which IMO would be clearer if I could just write: > > while ((a, b) := calculate_next_couple

Re: The task is to invent names for things

2021-10-27 Thread dn via Python-list
On 27/10/2021 23.41, Karsten Hilbert wrote: > Am Tue, Oct 26, 2021 at 11:36:33PM + schrieb Stefan Ram: > >> xyzzy = lambda x: 2 * x >> >> . Sometimes, this can even lead to "naming paralysis", where >> one thinks excessively long about a good name. To avoid this >> naming paralysis, one

Re: Python script seems to stop running when handling very large dataset

2021-10-29 Thread dn via Python-list
On 30/10/2021 11.42, Shaozhong SHI wrote: > Python script works well, but seems to stop running at a certain point when > handling very large dataset. > > Can anyone shed light on this? Storage space? Taking time to load/format/process data-set? -- Regards, =dn -- https://mail.python.org/mailm

Re: The task is to invent names for things

2021-10-29 Thread dn via Python-list
On 29/10/2021 07.07, Stefan Ram wrote: > The name should not be "optimized" for a certain use case > (as for the use in an if expression) only. "We", "have", > and "any" carry little information. A name should pack as > much information as possible in as least characters as > possible. So

<    1   2   3   4   5   >