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: Line continuation and comments

2023-02-24 Thread dn via Python-list
, report print-outs, etc, tends to be at the (tender) mercy of (opinionated) users. By putting such into a separate file, such changes can be made without (as much) risk of 'breaking' the code itself. Ultimately, if you ever have to expand the application to multi-tenancy, such will beco

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 Fou

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

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

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

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 c

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

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 t

Re: Implementing a plug-in mechanism

2023-03-15 Thread dn via Python-list
organisation-specific mailer to be used instead of the generic one, if so desired This may call for the plug-in pattern, ie the user will choose whether to plug-in the specific, or the generic, module. In Python, we would tend to use a Dependency Injection approach (one of Uncle Bob's

Friday finking: IDE 'macro expansions'

2023-03-16 Thread dn via Python-list
es employed at pretty-much the NotePad level? Web.Refs: https://www.jetbrains.com/help/pycharm/settings-postfix-completion.html https://www.jetbrains.com/help/pycharm/using-live-templates.html#live_templates_types -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday finking: IDE 'macro expansions'

2023-03-17 Thread dn via Python-list
nt might be easily under-estimated. A 'simple find' may not be helpful - a web-search for Python turns-up irrelevant information about snakes! Regarding the tracing of an identifier: PyCharm has two features: - with cursor/caret on/at a single use of an identifier, it will highl

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 m

Re: Standard class for time *period*?

2023-03-28 Thread dn via Python-list
t to open a can-of-worms... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

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

2023-03-31 Thread dn via Python-list
e/choe/courses/20fall/315/lectures/slide23-solid.pdf https://www.hanselminutes.com/145/solid-principles-with-uncle-bob-robert-c-martin https://idioms.thefreedictionary.com/sword+of+Damocles https://en.wikipedia.org/wiki/Damocles -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Windows Gui Frontend

2023-04-02 Thread dn via Python-list
e with later-maintenance) can one start using one approach, switch to using the other, and then go back to the first? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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]

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

2023-04-05 Thread dn via Python-list
main__": main() - How can I get logging for 'do_stuff' in this case without explicitly passing 'logger' as an argument or using 'global'? Somehow I am failing to understand how to ge

Re: Initialising a Config class

2023-04-11 Thread dn via Python-list
ble into the config class - how to collect environment-data, and satisfying any/all demands for its use. Then, the application can be relieved of all detail ("give me what I want"), only asking for whatever it requires, when it requires, and in the format it requires - tailored and ready for immediate-use... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Dataclasses, immutability(?), and ChatGPT

2023-04-11 Thread dn via Python-list
created, their attributes cannot be modified. This can help to prevent unintended modifications to the data." The attribute-values within a data-class can be changed. In what way are Python dataclasses immutable? » ChatGPT did indeed clarify that: « You're correct that the attrib

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

Re: Pycharm IDE

2023-04-19 Thread dn via Python-list
art of the input() function? How about creating a string and then printing that, eg prompt = f'"I am thinking of a number between 1 to {LIMIT}" print( prompt ) NB because of the question asked earlier, the above code is NOT syntactically-correct Python! NBB am assuming there'

Re: Pycharm IDE

2023-04-19 Thread dn via Python-list
e list communications and ReplyList - you may need to do that manually... -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

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

2023-04-19 Thread dn via Python-list
some specific examples we can give specific answers. /I have an issue with the 'Light Blub', if I wanted suggestions I'd turn on that option... Assuming it's an option!/ The "light bulb" has little to do with "quotes"! This is one of the advantages of

Re: Pycharm IDE

2023-04-19 Thread dn via Python-list
ause we didn't have 'all those braces' (and other punctuation-characters) cluttering-up the code??? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-20 Thread dn via Python-list
TypeError occurred because "self" was passed as an input parameter to "myint". Can someone explain why this unexpected behavior occurs only in the latter case? I tested this issue on the following Python versions, and the problem persists on all of them: - Python 3.8.10 (default, N

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

Re: Addition of a .= operator

2023-05-20 Thread dn via Python-list
--- A custom-class wrapper? Even, a decorator-able function? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

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

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

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 Pyth

Re: Best practice for database connection

2023-05-31 Thread dn via Python-list
establishing a connection to the RDBMS. An operational RDBMS is part of the environment! Now (wait for many of our colleagues to hurriedly suck in their breath) we can see that the connection is a global-value - something which resides in a base "frame" of the Python stack, and is accordi

Using pydal for standalone scripts

2023-06-07 Thread Tobiah via Python-list
ttps://mail.python.org/mailman/listinfo/python-list

Re: Assistance Request - Issue with Installing 'pip' despite Python 3.10 Installation

2023-06-07 Thread Barry via Python-list
> On 7 Jun 2023, at 16:39, Florian Guilbault via Python-list > wrote: > > Dear Python Technical Team, > > I hope this email finds you well. I am reaching out to you today to seek > assistance with an issue I am facing regarding the installation of 'pip' &g

Re: Assistance Request - Issue with Installing 'pip' despite Python 3.10 Installation

2023-06-07 Thread MRAB via Python-list
On 2023-06-07 15:54, Florian Guilbault via Python-list wrote: Dear Python Technical Team, I hope this email finds you well. I am reaching out to you today to seek assistance with an issue I am facing regarding the installation of 'pip' despite my numerous attempts to resolve t

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 de

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

Re: Should NoneType be iterable?

2023-06-19 Thread dn via Python-list
On 20/06/2023 06.12, Neal Becker via Python-list wrote: On Mon, Jun 19, 2023 at 12:42 PM Chris Angelico via Python-list < python-list@python.org> wrote: On Tue, 20 Jun 2023 at 02:37, Peter Bona via Python-list wrote: Hi I am wondering if there has been any discussion why NoneType

Re: Should NoneType be iterable?

2023-06-20 Thread Barry via Python-list
> On 20 Jun 2023, at 01:57, Greg Ewing via Python-list > wrote: > > I would question the wisdom of designing an API that > can return either a sequence or None. I have some APIs that do return None or a list. The None says that a list is not available and that the caller is r

Re: Python Issue

2023-06-21 Thread dn via Python-list
On 22/06/2023 03.28, Pickle Pork via Python-list wrote: Python is unable to open. Exit Code: 1 This is not good. Please give some useful information: - from where did you download Python? - which operating system? - how do you "open" Python? etc. -- Regards, =dn -- https://mail.

Re: TKinter in Python - advanced notions

2023-06-21 Thread aapost via Python-list
On 6/21/23 09:47, Dan Kolis wrote: I've write a huge biotech program ( an IDE for synthetic biology ), and am slowly outgrowing TKINTER. Has anybody out there merged a little bit of TCL direct calls from Python 3.X to get more freedom then TKINTER for just some Windows ? I wish it l

pip install -e does not build shared libraries

2023-06-21 Thread Cebtenzzre via Python-list
When I try to use `pip install -e .` with llama-cpp-python or bitsandbytes, it doesn't build the shared libraries like `pip install .` does. In the case of llama-cpp-python, there is no _skbuild folder generated at all, just llama_cpp_python.egg-info. This results in an error when I try to i

Re: pip install -e does not build shared libraries

2023-06-21 Thread Cebtenzzre via Python-list
sion not found: > libbitsandbytes_cuda121_nocublaslt.so. Maybe you need to compile it > from source?". In this case, `python setup.py develop` does not seem > to work either. Correction: `make` must be run manually to build bitsandbytes. I made a mistake while testing. `make clean` doesn't work correctly, so I had to

Re: pip install -e does not build shared libraries

2023-06-22 Thread Cebtenzzre via Python-list
It turns out that this is a scikit-build issue: https://github.com/scikit-build/scikit-build/issues/740 https://github.com/scikit-build/scikit-build/issues/939 https://github.com/scikit-build/scikit-build/issues/981 -- https://mail.python.org/mailman/listinfo/python-list

Re: Trouble with defaults and timeout decorator

2023-06-24 Thread MRAB via Python-list
On 2023-06-24 17:18, Jason Friedman via Python-list wrote: I'm writing a database connectivity module to be used by other modules and leveraging the jaydebeapi module. From what I can tell jaydebeapi contains no built-in timeout capability, so then I turned to https://pypi.org/project/ti

Re: my excel file is not updated to add new data

2023-06-26 Thread dn via Python-list
Marc, Apologies for writing in English (the language of this Discussion List). I have attempted to keep the code in French... Thanks for this question. If it's OK with you, I would like to use it as an example-problem (and 'solution') challenge for some future Python Users

Re: What is this TEST BANK stuff ?

2023-07-06 Thread neopolitan via Python-list
it be eliminated ? Regards, Dan tl;dr It would be difficult to without changing the group to be moderated. I am very new but am working to build up a list of known spammers so I can auto-delete their nonsense from my machine. -- https://mail.python.org/mailman/listinfo/python-list

Hybrid meeting ANN: Using properties and descriptors

2023-07-11 Thread dn via Python-list
This month's meeting (Wed 19 July, 1800 for 1830 NZST = 0600/0630 UTC) will cover more-advanced OOP Python skills. You will be most-welcome to join us... "Using properties and descriptors" will look at a series of code-examples exploring problems and how these constructs o

Re: Canonical list of Python security vulnerabilities

2023-07-14 Thread Barry via Python-list
> On 14 Jul 2023, at 19:14, Bob Kline via Python-list > wrote: > > Can someone point me to the official catalog of security vulnerabilities in > Python (by which I mean cpython and the standard libraries)? I found > https://www.cvedetails.com/vulnerability-list/vendor_i

Re: Setup-tools

2023-07-15 Thread MRAB via Python-list
On 2023-07-15 07:12, YOUSEF EZZAT via Python-list wrote: Hey!. i face a problem when i get setup packages by pip when i code this : "pip install numpy" in my command line it gives me error "ModuleNotFoundError: No module named 'distutils'" please, i need

isinstance()

2023-08-02 Thread dn via Python-list
int | str (v3.10+) A question was asked about this at last night's PUG-meeting. The person was using the union option, but from Python v3.8. Sorting that out, he replaced the union with a list. No-go! Before correcting to a tuple... Why does the second argument need to be a tuple, given that

Re: How to find the full class name for a frame

2023-08-03 Thread dn via Python-list
On 04/08/2023 15.34, Jason Friedman via Python-list wrote: import inspect def my_example(arg1, arg2): print(inspect.stack()[0][3]) my_frame = inspect.currentframe() args,_,_,values = inspect.getargvalues(my_frame) args_rendered = [f"{x}: {values[x]}" for x in args] print(arg

Re: isinstance()

2023-08-04 Thread dn via Python-list
On 03/08/2023 11.38, Jon Ribbens via Python-list wrote: On 2023-08-02, dn wrote: Can you please explain why a multi-part second-argument must be a tuple and not any other form of collection-type? The following comment may hold a clue: if (PyTuple_Check(cls)) { /* Not a general

Re: isinstance()

2023-08-04 Thread dn via Python-list
On 05/08/2023 11.18, Chris Angelico via Python-list wrote: On Sat, 5 Aug 2023 at 09:08, dn via Python-list wrote: On 03/08/2023 11.38, Jon Ribbens via Python-list wrote: On 2023-08-02, dn wrote: Can you please explain why a multi-part second-argument must be a tuple and not any other form

Re: Where is the error?

2023-08-06 Thread dn via Python-list
On 07/08/2023 08.41, Peter J. Holzer via Python-list wrote: Mostly, error messages got a lot better in Python 3.10, but this one had me scratching my head for a few minutes. ... The error message is now a lot better, of course, but the fact that it points at the expression *before* the error

Re: Where is the error?

2023-08-07 Thread Barry via Python-list
> On 7 Aug 2023, at 05:28, Cameron Simpson via Python-list > wrote: > > Used to use a Pascal compiler once which was uncannily good at suggesting > where you'd missing a semicolon. Was that on DEC VMS? It was a goal at DEC for its compilers to do this well. They could

Mtg ANN: Using computer vision AI to help protect the worlds rarest dolphin

2023-08-08 Thread dn via Python-list
course...) The Auckland Branch of the New Zealand Python Users' Group meet twice monthly. You're very welcome to attend online or in-person (as available). Meeting location-details or URL will be sent to those who RSVP. We are a healthy mix of Python users. Students, academics,

Re: Planning a Python / PyData conference

2023-08-08 Thread dn via Python-list
Hi Wilber, On 09/08/2023 14.28, Wilber H via Python-list wrote: Hi, I would like to plan a Python / PyData conference in the country of the Dominican Republic, and would like your feedback on how to best plan for the conference. Recommend making your request of the folks who organise

Re: Imports and dot-notation

2023-08-09 Thread dn via Python-list
On 09/08/2023 22.30, Oliver Schinagl via Python-list wrote: ...> Looking at a python projects code and repository layout, we see the following directory structure. /project/core /project/components/module1 ... /project/components/moduleN /projects/util ...> Some modules import other m

GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread c.buhtz--- via Python-list
X-Post: https://stackoverflow.com/q/76913082/4865723 I want to display one string in its original source (untranslated) version and in its translated version site by site without duplicating the string in the python source code? It wouldn't be a big deal if it is only one word.

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread Mirko via Python-list
Am 17.08.23 um 09:10 schrieb c.buhtz--- via Python-list:     UnboundLocalError: local variable '_' referenced before assignment This is a common gotcha: https://docs.python.org/3/faq/programming.html#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value You could s

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread c.buhtz--- via Python-list
Hello Mirko, thanks for reply. Am 17.08.2023 18:19 schrieb Mirko via Python-list: You could solve it by defining _() locally like so: def foobar(translate): _ = gettext.gettext I see no way to do that. It is not the "class based API" of gettext installing _() into th

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread Mirko via Python-list
Am 17.08.23 um 21:17 schrieb c.buhtz--- via Python-list: Hello Mirko, thanks for reply. Am 17.08.2023 18:19 schrieb Mirko via Python-list: You could solve it by defining _() locally like so: def foobar(translate):     _ = gettext.gettext I see no way to do that. It is not the "class

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-18 Thread Barry via Python-list
> On 17 Aug 2023, at 15:01, c.buhtz--- via Python-list > wrote: > > I want to display one string in its original source (untranslated) version > and in its translated version site by site without duplicating the string in > the python source code? > It wouldn't b

Re: Context manager for database connection

2023-08-23 Thread dn via Python-list
On 24/08/2023 03.41, Jason Friedman via Python-list wrote: I want to be able to write code like this: with Database() as mydb: conn = mydb.get_connection() cursor = conn.get_cursor() cursor.execute("update table1 set x = 1 where y = 2") cursor.close() cursor = conn.get_cursor() curs

Re: Context manager for database connection

2023-08-23 Thread dn via Python-list
On 24/08/2023 06.11, dn via Python-list wrote: On 24/08/2023 03.41, Jason Friedman via Python-list wrote: with Database() as mydb: conn = mydb.get_connection() cursor = conn.get_cursor() cursor.execute("update table1 set x = 1 where y = 2") cursor.close() cursor = conn.

Co-op Group: Django web framework

2023-08-28 Thread dn via Python-list
Learning Django Co-op. RSVP at https://www.meetup.com/nzpug-auckland/events/295727130/ -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Using "textwrap" package for unwrappable languages (Japanese)

2023-08-30 Thread c.buhtz--- via Python-list
ators handle the line breaks. But I would like to avoid it because some of them don't know what "\n" means and they don't know the length rule (in my case 65 characters). Any ideas about it? Kind Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Using "textwrap" package for unwrappable languages (Japanese)

2023-08-30 Thread c.buhtz--- via Python-list
Dear Peter, thanks for your reply. That is a very interesting topic. I was a bit wrong. I realized that textwrap.wrap() do insert linebreaks when "words" are to long. So even a string without any blank space well get wrapped. Am 30.08.2023 14:07 schrieb Peter J. Holzer via P

Re: f-string error message

2023-08-30 Thread Random832 via Python-list
On Sun, Aug 27, 2023, at 17:19, Rob Cliffe via Python-list wrote: > I understand that this is an error: I'm telling the f-string to expect > an integer when in fact I'm giving it a Decimal. > And indeed f"{x:3}" gives ' 42' whether x is an int or a Decim

Re: Passing info to function used in re.sub

2023-09-03 Thread MRAB via Python-list
On 2023-09-03 17:10, Jan Erik Moström via Python-list wrote: I'm looking for some advice for how to write this in a clean way I want to replace some text using a regex-pattern, but before creating replacement text I need to some file checking/copying etc. My code right now look something

Re: Forward References

2023-09-03 Thread MRAB via Python-list
On 2023-09-03 21:43, Jonathan Gossage via Python-list wrote: I am attempting to use forward references in my program and I am failing. This also does not work with the older way of putting the name of a class as a string. Here is some sample code: from __future__ import annotations from

Re: Finding good documentation for gpiod

2023-09-03 Thread Barry via Python-list
E > On 3 Sep 2023, at 22:49, Chris Green via Python-list > wrote: > > Mostly I am managing to get things to work as I want but better > documentation of gpiod would be a great help. Ask the author? https://github.com/aswild/python-gpiod Maybe read the source code for hints?

ANN: Wed 20 Sep: Terminal-based user interfaces (TUIs) with ease using Textual

2023-09-07 Thread dn via Python-list
Rodrigo's back! Fresh from his successes at EuroPython... You are invited to join the next virtual NZPUG Auckland Branch meeting (Wed 20 Sep, 1830~2030 local, ie 0630~0830 UTC) Learn how to build powerful terminal-based user interfaces (TUIs) with ease using Textual - an open-source P

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-11 Thread Mirko via Python-list
Am 11.09.23 um 14:30 schrieb John O'Hagan via Python-list: I was surprised that the code below prints 'called' three times. from tkinter import * from tkinter.ttk import * root=Tk() def callback(*e):     print('called') tree = Treeview(root) tree.pack() iid = tree

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-12 Thread MRAB via Python-list
On 2023-09-12 06:43, John O'Hagan via Python-list wrote: On Mon, 2023-09-11 at 22:25 +0200, Mirko via Python-list wrote: Am 11.09.23 um 14:30 schrieb John O'Hagan via Python-list: > I was surprised that the code below prints 'called' three times. > > &g

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-12 Thread Mirko via Python-list
Am 12.09.23 um 07:43 schrieb John O'Hagan via Python-list: My issue is solved, but I'm still curious about what is happening here. MRAB already said it: When you enter the callback function, Tk's mainloop waits for it to return. So what's happening is: 1. Tk

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-12 Thread MRAB via Python-list
On 2023-09-12 19:51, Mirko via Python-list wrote: Am 12.09.23 um 07:43 schrieb John O'Hagan via Python-list: My issue is solved, but I'm still curious about what is happening here. MRAB already said it: When you enter the callback function, Tk's mainloop waits for it to re

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-12 Thread MRAB via Python-list
On 2023-09-13 00:40, John O'Hagan via Python-list wrote: On Tue, 2023-09-12 at 20:51 +0200, Mirko via Python-list wrote: Am 12.09.23 um 07:43 schrieb John O'Hagan via Python-list: > My issue is solved, but I'm still curious about what is happening > here. MRAB already sa

PEP668 / pipx and "--editable" installs

2023-09-15 Thread c.buhtz--- via Python-list
Hello, I wonder that today was the first day I stumbled over PEP668 / pipx and the "externally-managed-environment" problem. I migrated from Debian 11 to 12. I'm developing some Python packages; applications and libraries. I never used virtual environments and wouldn't l

`time.perf_counter_ns` always a 64-bit int?

2023-09-15 Thread rmlibre--- via Python-list
t could. Does anyone know if any such platform agnostic assumption could be made for any fixed number of bytes, even if it isn't exactly 8 bytes? -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP668 / pipx and "--editable" installs

2023-09-15 Thread c.buhtz--- via Python-list
Dear Rimu, thanks for your reply. I'm willing to learn for sure. On 2023-09-16 14:17 Rimu Atkinson via Python-list wrote: > There's your problem - everything else is a result of this. There is > just no nice way to work with a combination of pypi, apt-get and >

Re: `time.perf_counter_ns` always a 64-bit int?

2023-09-16 Thread Barry via Python-list
> On 15 Sep 2023, at 23:00, rmlibre--- via Python-list > wrote: > > I'd like to capture the output of `time.perf_counter_ns()` as an 8-byte > timestamp. > > I'm aware that the docs provide an undefined start value for that clock. > I'm going to assume

Confusing behavior of PYTHONWARNINGS

2023-09-17 Thread Meowxiik via Python-list
Hello, For the third time I am trying to work with `PYTHONWARNINGS` filter, and for the third time I am having a terrible time. I'd like to seek your assistance, I have a few questions: **Question 1:** Does the environment variable only matter at python interpreter startup time? If

Re: Why doc call `__init__` as a method rather than function?

2023-09-17 Thread anthony.flury via Python-list
: ie the obj's attributes would be reset to whatever the __init__ sets them to - if you need to do that it might be better to have a reset method. Regards, Tony -- Original Message -- From: "scruel tao via Python-list" To: "python-list@python.org" Sent: Frid

Re: PEP668 / pipx and "--editable" installs

2023-09-17 Thread c.buhtz--- via Python-list
Thanks for your reply. btw: I do know what a virtual environment is and how its works. No need to explain. And again: I do expect "pipx" to use virtual environments. So this thread is not about pro and cons of using virtual environments. On 2023-09-17 11:57 Rimu Atkinson via Python-l

Re: PEP668 / pipx and "--editable" installs

2023-09-18 Thread c.buhtz--- via Python-list
On 2023-09-18 10:16 "Peter J. Holzer via Python-list" wrote: > On 2023-09-15 14:15:23 +, c.buhtz--- via Python-list wrote: > > I tried to install it via "pipx install -e .[develop]". It's > > pyproject.toml has a bug: A missing dependency "dateut

Re: Python Launcher Pops Up When Py-based App Is Running (Mac)

2023-09-18 Thread dn via Python-list
On 17/09/2023 13.20, James Greenham via Python-list wrote: Hello, On the face of it, the Python-Mac mailing list is largely inactive so I'm posting here since it looks like this one is livelier. What happens when doGrab() is called from the REPL, after being 'fed' data you

Re: PEP668 / pipx and "--editable" installs

2023-09-20 Thread c.buhtz--- via Python-list
Dear Peter, maybe we have a missunderstanding. Am 20.09.2023 14:43 schrieb Peter J. Holzer via Python-list: > > "dateutil" is not available from PyPi for Python 3.11 That's quite a curious thing to write if you are aware that dateutil is in fact available from PyPi fo

Re: The GIL and PyEval_RestoreThread

2023-09-26 Thread MRAB via Python-list
On 2023-09-26 14:20, Peter Ebden via Python-list wrote: Hi all, I've been working on embedding Python and have an interesting case around locking with PyEval_RestoreThread which wasn't quite doing what I expect, hoping someone can explain what I should expect here. I have a little ex

Re: error of opening Python

2023-09-26 Thread MRAB via Python-list
On 2023-09-27 03:30, Chris Roy-Smith via Python-list wrote: On 26/9/23 22:27, Abdelkhelk ashref salay eabakh via Python-list wrote: Dear Python team, This is my not first time using Python, I tried to launch Python and it showed I'm no expert but.... "Python 3.11.3 (tags/v3.11

Re: path to python in venv

2023-09-27 Thread dn via Python-list
On 28/09/2023 09.32, Jon Ribbens via Python-list wrote: On 2023-09-27, Larry Martell wrote: On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list wrote: On 2023-09-27, Larry Martell wrote: I was under the impression that in a venv the python used would be in the venv's bin dir

Re: venv --upgrade 3.12.0rc2 --> 3.12.0rc3 failure

2023-09-28 Thread Barry via Python-list
> On 27 Sep 2023, at 12:50, Robin Becker via Python-list > wrote: > > Attempting venv upgrade 3.12.0rc2 --> 3.12.0rc3 I find pyvenv.cfg changes, > but the virtual python doesn't. > I guess this ought to be a bug. You must delete and then recreate the venv if the

Re: error of opening Python

2023-09-29 Thread anthony.flury via Python-list
This isn't an error. This is just a normal Python Header message announcing that you are using Python 3.11.3 The rest is just information from the build system : The build Id, the date/time the build was made, and the version of the compiler. There is nothing to fix. -- Ori

Re: type annotation vs working code

2023-09-30 Thread dn via Python-list
On 01/10/2023 08.00, Karsten Hilbert via Python-list wrote: A type annotation isn't supposed to change what code does, or so I thought: # class Borg: _instances:dict = {} def __new__(cls, *args, **

Re: type annotation vs working code

2023-09-30 Thread dn via Python-list
On 01/10/2023 11.25, Karsten Hilbert via Python-list wrote: Am Sun, Oct 01, 2023 at 09:04:05AM +1300 schrieb dn via Python-list: class WorkingSingleton(Borg): def __init__(self): print(self.__class__.__name__, ':')

Re: type annotation vs working code

2023-10-01 Thread Barry via Python-list
> On 1 Oct 2023, at 19:36, Richard Damon via Python-list > wrote: > > Perhaps a better method would be rather than just using the name and catching > the exception, use a real already_initialized flag (set to True when you > initialize), and look it up with getattr() wi

Re: How to write list of integers to file with struct.pack_into?

2023-10-02 Thread Barry via Python-list
On 2 Oct 2023, at 16:02, Jen Kris via Python-list wrote: Iwant to write a list of 64-bit integers to a binary file.  Everyexample I have seen in my research convertsit to .txt, but I want it in binary.  I wrote this code,based on some earlier work I have done: buf

<    5   6   7   8   9   10   11   12   13   14   >