Re: Enum + new in 3.11

2023-06-16 Thread dn via Python-list
On 16/06/2023 23.47, Thomas Passin via Python-list wrote: On 6/16/2023 1:40 AM, dn via Python-list wrote: Have you figured-out a use for the @enum.member and @enum.nonmember decorators (new in Python 3.11)? mypy is having trouble with 3.11 enums: "There are 83 open Enum mypy issues a

Enum + new in 3.11

2023-06-15 Thread dn via Python-list
Have you figured-out a use for the @enum.member and @enum.nonmember decorators (new in Python 3.11)? "What's New" says: Added the member() and nonmember() decorators, to ensure the decorated object is/is not converted to an enum member. The PSL docs say: @enum.member A decorator for use

Re: Best practice for database connection

2023-05-31 Thread dn via Python-list
On 01/06/2023 06.45, Thomas Passin wrote: On 5/31/2023 2:10 PM, Jason Friedman wrote: I'm trying to reconcile two best practices which seem to conflict. 1) Use a _with_ clause when connecting to a database so the connection is closed in case of premature exit. class_name = 'oracle.jdbc.OracleD

Re: complaint

2023-05-30 Thread dn via Python-list
Hi Daniel, On 31/05/2023 02.40, Daniel Ifechukwude Dibie wrote: i tried to uninstall the python 3.11.3 program from my machine so that i can re-install it is showing successful but it is ligerning on the program and features Is that word "lingering". If so, do you mean that Python did not uni

Re: OT: Addition of a .= operator

2023-05-23 Thread dn via Python-list
On 24/05/2023 12.27, Chris Angelico wrote: On Wed, 24 May 2023 at 10:12, dn via Python-list wrote: However, (continuing @Peter's theme) such confuses things when something goes wrong - was the error in the input() or in the float()? - particularly for 'beginners' - and yes, we

OT: Addition of a .= operator

2023-05-23 Thread dn via Python-list
On 24/05/2023 10.21, Rob Cliffe via Python-list wrote: This sort of code might be better as a single expression. For example: user = ( request.GET["user"] .decode("utf-8") .strip() .lower() ) user = orm.user.get(name=user) LOL.  And I thought I was the one with a (self-co

Re: Addition of a .= operator

2023-05-20 Thread dn via Python-list
On 21/05/2023 05.54, Alex Jando wrote: I have many times had situations where I had a variable of a certain type, all I cared about it was one of it's methods. For example: import hashlib hash = hashlib.sha256(b'word') hash = hash.he

Re: Disable 'style PEP' messages

2023-05-04 Thread dn via Python-list
On 05/05/2023 04.28, Kevin M. Wilson via Python-list wrote: Hi... How do I set Pycharm to find only syntax errors?!! Please review response to previous message re:configuring PyCharm's helpful features towards to coders and quality-coding... -- Regards, =dn -- https://mail.python.org/mailman

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-20 Thread dn via Python-list
On 21/04/2023 10.44, Lorenzo Catoni wrote: I am writing to seek your assistance in understanding an unexpected behavior that I encountered while using the __enter__ method. I have provided a code snippet below to illustrate the problem: It is expected behavior - just not what WE might have expe

Re: Pycharm IDE

2023-04-19 Thread dn via Python-list
On 20/04/2023 08.59, Thomas Passin wrote: On 4/19/2023 4:06 PM, Mark Bourne wrote: print(f'{LIMIT}) ^ I think this one should be: print(f'{LIMIT}') with the closing quote ;o) Yup a typo!  Where's pylint when I need it? but (and you designed it this way - right?) an excellent object-less

Re: PyCharm's strict PEP and not so strict?

2023-04-19 Thread dn via Python-list
there'll be many who are unable to understand your/my aphorisms and allusions. Hence trying to stay with a more 'international English'. "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you wal

Re: PyCharm's strict PEP and not so strict?

2023-04-19 Thread dn via Python-list
On 20/04/2023 04.25, Alan Gauld wrote: On 19/04/2023 10:51, Kevin M. Wilson via Python-list wrote:  I'm in a bit of a quandary, I want some strict syntax errors to be flagged, OK, You might want to use a "linter" in that case because most tools use the interpreter itself to flag syntax errors

Re: Pycharm IDE

2023-04-19 Thread dn via Python-list
On 19/04/2023 21.13, Kevin M. Wilson wrote: Sorry the code snippet I sent was what is written in PyCharm. LIMIT is defined and is not causing an error! PyCharm is flagging the Parentheses at the end. It is not seeing the Parentheses as the end of the print function. def play_game(): number= ra

Re: Pycharm IDE

2023-04-19 Thread dn via Python-list
Kevin, As mentioned in another response, the format of these messages seems very confused. Please copy-paste all of (the pertinent part of) the code, and ensure that the line-endings are in the correct places, tab/indentation looks correct, etc? (this will allow us to copy the same code into

Re: Pycharm IDE

2023-04-18 Thread dn via Python-list
On 19/04/2023 11.18, Kevin M. Wilson via Python-list wrote: Greetings... Kevin here:I need help, as you have guessed!I have this line: The Print Statement... Why complain about a 'comma', or a ')'???def play_game(): number = random.randint(1, LIMIT) print (f'"I am thinking of a number

Dataclasses, immutability(?), and ChatGPT

2023-04-11 Thread dn via Python-list
Are dataclasses (or instances thereof) mutable or immutable? - and in what sense? Have been experimenting with ChatGPT. In particular: its possibilities as a trainer, good ideas for methods of introducing new topics, its capability for drawing-up demonstrations or examples, its interpretation

Re: Initialising a Config class

2023-04-11 Thread dn via Python-list
On 12/04/2023 02.29, Loris Bennett wrote: Hi, Having solved my problem regarding setting up 'logger' such that it is ... My reading suggests that setting up a module with a Config class which can be imported by any part of the program might be a reasonable approach: ... However, in my conf

Re: When is logging.getLogger(__name__) needed?

2023-04-05 Thread dn via Python-list
Thank you for carefully considering suggestions (and implications) - and which will 'work' for you. Further comment below (and with apologies that, unusually for me, there are many personal opinions mixed-in):- On 06/04/2023 01.06, Loris Bennett wrote: "Loris Bennett" writes: dn writes:

Re: [Python-Dev] Small lament...

2023-04-03 Thread dn via Python-list
On 04/04/2023 12.14, Guido van Rossum wrote: A bit late, this reached my inbox: https://peternorvig.medium.com/new-python-operators-9f31b56ddcc7 Did you notice that Peter Norvig's factorial-operator attempts to replace one of the very first diamond-grade provisions of [the] FLUFL? Disgracefu

Re: Windows Gui Frontend

2023-04-02 Thread dn via Python-list
On 03/04/2023 02.45, Michael Torrie wrote: On 4/2/23 05:09, Dietmar Schwertberger wrote: I also did evaluate all the GUI builder from time to time between 2000 and 2016 to find one that I could recommend to colleagues, but could not find one. Then I started contributing to wxGlade and I can s

Re: When is logging.getLogger(__name__) needed?

2023-03-31 Thread dn via Python-list
On 01/04/2023 02.01, Loris Bennett wrote: Hi, In my top level program file, main.py, I have def main_function(): parser = argparse.ArgumentParser(description="my prog") ... args = parser.parse_args() config = configparser.ConfigParser() if args.config_f

Re: Python file location

2023-03-29 Thread dn via Python-list
On 30/03/2023 09.47, windhorn wrote: I have an older laptop I use for programming, particularly Python and Octave, running a variety of Debian Linux, and I am curious if there is a "standard" place in the file system to store this type of program file. OK, I know they should go in a repository

Re: Standard class for time *period*?

2023-03-28 Thread dn via Python-list
1. Is there a standard class for a 'period', i.e. length of time specified by a start point and an end point? The start and end points could obviously be datetimes and the difference a timedelta, but the period '2022-03-01 00:00 to 2022-03-02 00:00' would be different to '2023-03-01 0

Re: Friday finking: IDE 'macro expansions'

2023-03-18 Thread dn via Python-list
On 19/03/2023 01.27, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2023-03-18 at 11:49:24 +, "Weatherby,Gerard" wrote: For templating, I have two Python programs for starting new work. One generates a standalone Python program with the Python shebang, a __main__ which calls def main(), and

Re: Friday finking: IDE 'macro expansions'

2023-03-17 Thread dn via Python-list
On 18/03/2023 02.44, Thomas Passin wrote: On 3/17/2023 9:38 AM, Simon Ward wrote: On Fri, Mar 17, 2023 at 02:05:50PM +0100, Roel Schroeven wrote: Even better than simply highlighting is (IMO) a thing called "Rainbow Braces" or "Bracket Pair Colorization" I recently learned about: both braces o

Friday finking: IDE 'macro expansions'

2023-03-16 Thread dn via Python-list
It is a long, long, time since I've thrown one of these into the maelstrom of our musings. (have the nightmares receded?) Do you make use of your IDE's expansionist tendencies, and if-so, which ones? NB this is where vi/emacs enthusiasts start chuckling (polite term for 'insane cackling').

Re: Implementing a plug-in mechanism

2023-03-15 Thread dn via Python-list
On 16/03/2023 01.47, Loris Bennett wrote: I have written a program which, as part of the non-core functionality, contains a module to generate email. This is currently very specific to my organisation, so the main program contains import myorg.mailer This module is specific to my organisati

ANN: The long white computing cloud

2023-03-07 Thread dn via Python-list
The long white computing cloud - hybrid meeting, ie both in-person and virtual attendance Wed 15 March, 1800 for 1830 (NZDT) = 0530 UTC 1 Cloud and Proud - Digital Sovereignty in Aotearoa Doug Dixon, CEO of Catalyst Cloud, Aotearoa New Zealand's cloud provider. 2 Python in the cloud How to get-

Re: test

2023-03-07 Thread dn via Python-list
On 08/03/2023 11.48, Jim Byrnes wrote: haven't received anything from the list for quite awhile. Got no response when I tried to contact the administrator. ACK -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Cutting slices

2023-03-05 Thread dn via Python-list
On 06/03/2023 11.59, aapost wrote: On 3/5/23 17:43, Stefan Ram wrote:    The following behaviour of Python strikes me as being a bit    "irregular". A user tries to chop of sections from a string,    but does not use "split" because the separator might become    more complicated so that a regula

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread dn via Python-list
On 04/03/2023 20.47, Peter J. Holzer wrote: On 2023-03-03 13:51:11 -0500, avi.e.gr...@gmail.com wrote: ... No. Even before Python existed there was the adage "a real programmer can write FORTRAN in any language", indicating that idiomatic usage of a language is not governed by syntax and libra

Re: Python list insert iterators

2023-03-03 Thread dn via Python-list
On 03/03/2023 21.22, Guenther Sohler wrote: Hi Python community, I have a got an example list like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 T T and i eventually want to insert items in the given locations (A shall go between 2 and 3, B shall go between 6 and 7) Right now i jus

Re: Python 3.10 Fizzbuzz

2023-02-28 Thread dn via Python-list
On 28/02/2023 12.55, Rob Cliffe via Python-list wrote: On 27/02/2023 21:04, Ethan Furman wrote: On 2/27/23 12:20, rbowman wrote: > "By using Black, you agree to cede control over minutiae of hand- > formatting. In return, Black gives you speed, determinism, and freedom > from pycodestyle nagg

Re: TypeError: can only concatenate str (not "int") to str

2023-02-24 Thread dn via Python-list
On 25/02/2023 09.36, Hen Hanna wrote: TypeError: can only concatenate str (not "int") to str thanks for the comments, --- esp. 2 or 3 (?) ppl who directly addressed it or commented on it. If you haven't already, please review the Python Software Foundation's Code o

Re: Line continuation and comments

2023-02-24 Thread dn via Python-list
On 25/02/2023 10.04, Mark Bourne wrote: Personally, I don't particularly like the way you have to put multiline strings on the far left (rather than aligned with the rest of the scope) to avoid getting spaces at the beginning of each line.  I find it makes it more difficult to see where the sco

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread dn via Python-list
On 25/02/2023 08.12, Peter J. Holzer wrote: On 2023-02-24 16:12:10 +1300, dn via Python-list wrote: In some ways, providing this information seems appropriate. Curiously, this does not even occur during an assert exception - despite the value/relationship being the whole point of using the

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-23 Thread dn via Python-list
On 23/02/2023 09.05, Hen Hanna wrote: > py bug.py Traceback (most recent call last): File "C:\Usenet\bug.py", line 5, in print( a + 12 ) TypeError: can only concatenate str (not "int") to str Why doesn't Python (error msg) do t

Re: Line continuation and comments

2023-02-23 Thread dn via Python-list
On 24/02/2023 12.45, Weatherby,Gerard wrote: “ NB my PyCharm-settings grumble whenever I create an identifier which is only used once (and perhaps, soon after it was established). I understand the (space) optimisation, but prefer to trade that for 'readability'. “ I haven’t seen that one. What I

Re: Line continuation and comments

2023-02-23 Thread dn via Python-list
On 22/02/2023 21.49, Robert Latest via Python-list wrote: I found myself building a complicated logical condition with many ands and ors which I made more manageable by putting the various terms on individual lines and breaking them with the "\" line continuation character. In this context it wou

Re: Typing Number, PyCharm

2023-02-05 Thread dn via Python-list
rint(double(Fraction(7, 8))) /# print(double("7")) PyCharm properly complains/ *From: *Python-list on behalf of dn via Python-list *Date: *Saturday, February 4, 2023 at 9:32 PM *To: *'Python' *Subject: *Typing Number, PyCharm *** Attention: This is an external email. Use caution

Typing Number, PyCharm

2023-02-04 Thread dn via Python-list
Do we have a typing type-hint for numbers yet? Often wanting to combine int and float, discovered that an application was doing a walk-through with/for uses three numeric types. Was intrigued to note variance, in that the code-set features two different methods for typing, in this situation:

Re: Organizing modules and their code

2023-02-03 Thread dn via Python-list
On 04/02/2023 16.24, Thomas Passin wrote: On 2/3/2023 5:14 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: Keep It Simple:  Put all four modules at the top level, and run with it until you falsify it.  Yes, I would give you that same advice no matter what language you're using. In my recent mess

Re: evaluation question

2023-01-31 Thread dn via Python-list
On 01/02/2023 11.59, Greg Ewing wrote: On 31/01/23 10:24 pm, mutt...@dastardlyhq.com wrote: All languages have their ugly corners due to initial design mistakes and/or constraints. Eg: java with the special behaviour of its string class, C++ with "=0" pure virtual declaration. But they don't du

Re: logically Boolean

2023-01-28 Thread dn via Python-list
On 29/01/2023 09.28, Chris Angelico wrote: The REAL boolean is the friends we made along the way? By REAL did you mean float - True or False? (for the FORTRAN-free: https://fortranwiki.org/fortran/show/real) -- -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: evaluation question

2023-01-27 Thread dn via Python-list
On 28/01/2023 05.37, mutt...@dastardlyhq.com wrote: This is probably a dumb newbie question but I've just started to learn python3 and eval() isn't behaving as I'd expect in that it works for some things and not others. eg: eval("1+1") 2 eval("print(123)") 123 eval("for i in range(1,10): i"

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread dn via Python-list
On 19/01/2023 08.56, Mats Wichmann wrote: On 1/18/23 12:29, Paul Bryan wrote: ... import os as    os import sys as   sys import importlib as importlib A general comment: there are some very common "import ... as" idioms (for example, i

Re: Fast lookup of bulky "table"

2023-01-15 Thread dn via Python-list
On 16/01/2023 08.36, Weatherby,Gerard wrote: I think any peformance improvements would have to come from a language change or better indexing of the data. Exactly! Expanding on @Peter's post: databases (relational or not) are best organised according to use. Some must accept rapid insert/upd

Re: How to set environmental variables for Python

2022-01-17 Thread dn via Python-list
On 17/01/2022 22.31, Shaozhong SHI wrote: > I got quite a few version of Python on my machine. > > How do I set environmental variables for Python 3.6.1 to work? Set from Python, or set in the OpSys? https://docs.python.org/3/library/os.html?highlight=environment%20variable MS-Win: https://doc

Re: Writing a string with comma in one column of CSV file

2022-01-15 Thread dn via Python-list
On 16/01/2022 09.56, Mahmood Naderan via Python-list wrote: > Hi, > I use the following line to write some information to a CSV file which is > comma delimited. > > f = open(output_file, 'w', newline='') > wr = csv.writer(f) > ... > f.write(str(n) + "," + str(key) + "\n" ) > > > Problem is that

Re: What to write or search on github to get the code for what is written below:

2022-01-13 Thread dn via Python-list
On 14/01/2022 09.48, Dennis Lee Bieber wrote: > On Thu, 13 Jan 2022 15:22:50 -0500, Dennis Lee Bieber > declaimed the following: > > Talking to myself in public again... Bad habit... Recommend that you not start any arguments then - they will be unwinnable! -- Regards, =dn -- https://ma

Re: Extracting dataframe column with multiple conditions on row values

2022-01-07 Thread dn via Python-list
Salaam Mahmood, On 08/01/2022 12.07, Mahmood Naderan via Python-list wrote: >I have a csv file like this >V0,V1,V2,V3 >4,1,1,1 >6,4,5,2 >2,3,6,7 > >And I want to search two rows for a match and find the column. For >example, I want to search row[0] for 1 and row[1] fo

Re: Selection sort

2021-12-24 Thread dn via Python-list
On 25/12/2021 03.22, vani arul wrote: > Hello, > I am trying write a code.Can some help me find the error in my code. > Thanks! > > > def selectionsort(arr): ># le=len(arr) > for b in range(0,len(arr)-1): > pos=b > for a in range(b+1,len(arr)-1): > if arr[b]>ar

Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-12-21 Thread dn via Python-list
On 30/11/2021 12.31, Cameron Simpson wrote: > On 30Nov2021 10:59, DL Neil wrote: ... >> I've nominated Kitty as >> Fedora's default terminal. We'll see how it goes with work-loads beyond >> raising the flag... > > I'd like to hear how that goes down the track. If I find myself on a > Linux desk

Re: Return

2021-12-07 Thread dn via Python-list
On 08/12/2021 11.07, Chris Angelico wrote: > On Wed, Dec 8, 2021 at 9:04 AM dn via Python-list > wrote: >> >> plus Python, unlike some other languages, allows us to return multiple >> values, either as a collection or as an implied-tuple: >> >> def function_

Re: Return

2021-12-07 Thread dn via Python-list
On 08/12/2021 09.45, Roland Mueller via Python-list wrote: > Hello > > ti 7. jouluk. 2021 klo 19.47 vani arul (arulvan...@gmail.com) kirjoitti: > >> Hey There, >> Can someone help to understand how a python function can return value with >> using return in the code? >> It is not not about explici

PyCharm settings - per: print('\N{flag: Mauritius}') not supported in py3.9

2021-12-01 Thread dn via Python-list
On 29/11/2021 10.08, dn via Python-list wrote: > On 29/11/2021 02.18, Chris Angelico wrote: >> On Mon, Nov 29, 2021 at 12:10 AM Abdur-Rahmaan Janhangeer >> wrote: >> >> Flags are actually constructed from multiple codepoints. What you want >> is to insert each

Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-29 Thread dn via Python-list
On 30/11/2021 10.19, Cameron Simpson wrote: > On 29Nov2021 22:25, DL Neil wrote: Probably a font issue. Not many fonts support the flags. >>> >>> Agree about the font support. Some terminal emulators make an effort to >>> have fallback fonts for when your preferred font lacks a glyph. IIRC >>

Re: Negative subscripts

2021-11-29 Thread dn via Python-list
On 27/11/2021 21.23, Chris Angelico wrote: > On Sat, Nov 27, 2021 at 7:21 PM dn via Python-list > wrote: >> The expression list is evaluated once; it should yield an iterable >> object. An iterator is created for the result of the expression_list. >> The suite is the

Re: Failure to Display Top menu

2021-11-29 Thread dn via Python-list
On 30/11/2021 07.43, Peter Mwale wrote: > Hello Christian, > Am referring to menu marked in picture below. It's not coming on my window. > > > On Sat, Nov 27, 2021, 20:19 Christian Gollwitzer wrote: > >> Am 26.11.21 um 21:38 schrieb Peter Mwale: >>> Hello, my python 3.10 shell is not displaying

Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-29 Thread dn via Python-list
On 29/11/2021 12.06, Cameron Simpson wrote: > On 29Nov2021 09:19, Chris Angelico wrote: >> On Mon, Nov 29, 2021 at 8:10 AM dn via Python-list >> wrote: >>> However, when trying the above, with our local flag in (Fedora Linux, >>> Gnome) Terminal or PyCharm's

Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-28 Thread dn via Python-list
On 29/11/2021 02.18, Chris Angelico wrote: > On Mon, Nov 29, 2021 at 12:10 AM Abdur-Rahmaan Janhangeer > wrote: > > Flags are actually constructed from multiple codepoints. What you want > is to insert each codepoint separately. You can see them listed in the > second column of the table you link

Re: Negative subscripts

2021-11-27 Thread dn via Python-list
On 27/11/2021 19.11, Frank Millman wrote: > On 2021-11-26 11:24 PM, dn via Python-list wrote: >> On 26/11/2021 22.17, Frank Millman wrote: >>> In my program I have a for-loop like this - >>> >>>>>> for item in x[:-y]: >>> ...    [do stuff]

Friday Finking: Docstrings and DataClasses

2021-11-26 Thread dn via Python-list
How have you updated your (team's) standards and conventions for docstrings, when using dataclasses? NB the question is specifically class-related. Whereas many of the examples 'here' are of functions; a docstring is a docstring, is a docstring. The original word on the subject is/was "PEP 257

Re: Negative subscripts

2021-11-26 Thread dn via Python-list
On 26/11/2021 22.17, Frank Millman wrote: > In my program I have a for-loop like this - > for item in x[:-y]: > ...    [do stuff] > > 'y' may or may not be 0. If it is 0 I want to process the entire list > 'x', but of course -0 equals 0, so it returns an empty list. ... > But in my actual p

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-19 Thread dn via Python-list
On 20/11/2021 10.21, Chris Angelico wrote: > On Sat, Nov 20, 2021 at 7:39 AM dn via Python-list > wrote: >>>> >>> 0.3 + 0.3 + 0.3 == 0.9 >>>> False >>> >>> That's because 0.3 is not 3/10. It's not because floats are >>>

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-19 Thread dn via Python-list
On 20/11/2021 09.17, Chris Angelico wrote: > On Sat, Nov 20, 2021 at 5:08 AM ast wrote: >> Le 19/11/2021 à 03:51, MRAB a écrit : >>> On 2021-11-19 02:40, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2021-11-18 at 23:16:32 -0300, René Silva Valdés wrote: > Working with floats i notic

Re: import question

2021-11-19 Thread dn via Python-list
On 20/11/2021 03.38, lucas wrote: > ok. all good advice. thank you for that. and with all that I've decided > what to do. > > I'm going to close off any server-side python access so that I don't expose > my server or the file system to vulnerabilities and/or wonton attacks. I am > building

Re: Advantages of Default Factory in Dataclasses

2021-11-16 Thread dn via Python-list
On 17/11/2021 02.04, Abdur-Rahmaan Janhangeer wrote: > A simple question: why do we need field(default_factory ) in dataclasses? > > Why not make that field as an attribute return a function? > > Useful implementation examples / use cases appreciated. It's an interesting question: We could defi

OT: Alternatives to Jupyter Notebook

2021-11-15 Thread dn via Python-list
On 15/11/2021 12.24, Paige Bailey wrote: > If you're experiencing issues with Jupyter, perhaps try JupyterLab: > JupyterLab Documentation — JupyterLab 3.2.3 documentation > > > Or VS Code, which is also open-source and has support for Jupyter notebook

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread dn via Python-list
On 13/11/2021 10.51, Abdur-Rahmaan Janhangeer wrote: > Greetings list, > > Let's say i created a package named miaw > > miaw also has a cli command called miaw > > miaw prints files and folders in the directory it is called in > > except that when miaw is used, it prints the files and folders i

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

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-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: 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: 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: 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: > r...@zedat.fu-berlin.de (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: 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: >

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: 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 ::== ...

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-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 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: 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: 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 hongy...@gmail.com > wrote: >> >> On Saturday, October 2, 2021 at 4:59:54 PM UTC+8, ju...@diegidio.name wrote: This thread seems to have been very one-sided. Either I've forgotten selective use of the DEL-key, or the abo

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: 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: 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, 2qdxy4rzwzuui...@potatochowder.com 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: 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 <2qdxy4rzwzuui...@potatochowder.com> 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: 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

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 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

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-25 Thread dn via Python-list
On 26/09/2021 10.48, 2qdxy4rzwzuui...@potatochowder.com 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: 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-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-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-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: 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: 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: 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: >>>> >>>&

<    1   2   3   4   5   >