Fwd: zipapp: add compression (method), compresslevel options from Zipfile

2025-11-17 Thread Mingye Wang via Python-list
-Rahmaan Janhangeer wrote: > > You have some demo code for it? > > > Kind Regards, > > Abdur-Rahmaan Janhangeer > about | blog > github > Mauritius > > On Mon, 10 Nov 2025, 07:18 Mingye Wang via Python-list, > wrote: >> >> Zipapp is meant to

Re: Conda create with python version fails me

2025-11-17 Thread Martin Schöön via Python-list
Den 2025-11-14 skrev Stefan Ram : > Martin =?UTF-8?Q?Sch=C3=B6=C3=B6n?= wrote or quoted: >>If I try to specify a python version I don't get a new environment. The >>error message I get is: >>"The following packages are missing from the target environment: >> - python=3.10" >> (if I asked for ver

Re: Sending FDs over UNIX domain sockets

2025-11-15 Thread Grant Edwards via Python-list
On 2025-11-16, Pokemon Chw via Python-list wrote: > On Linux AF_UNIX + SOCK_STREAM sockets, there is a quirk in how the > kernel handles control messages with SCM_RIGHTS: > > To successfully pass file descriptors via SCM_RIGHTS, you must send > at least one byte of normal d

Re: zipapp: add compression (method), compresslevel options from Zipfile

2025-11-15 Thread Abdur-Rahmaan Janhangeer via Python-list
You have some demo code for it? Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> | blog <https://compileralchemy.substack.com/> github <https://github.com/Abdur-RahmaanJ> Mauritius On Mon, 10 Nov 2025, 07:18 Mingye Wang via Python-list, < p

Re: Conda create with python version fails me

2025-11-14 Thread Martin Schöön via Python-list
Den 2025-11-13 skrev Loris Bennett : Hi Loris, Thanks for quick respons. > Martin Schöön writes: > >> >> I want to create a new environment using a specific python version >> rather than leaving that to conda. Cheat-sheets and online conda >> documentation tell me to use: >> >> conda create -n

Conda create with python version fails me

2025-11-13 Thread Martin Schöön via Python-list
About two years ago I moved from pip to conda. I have been happy with conda until yesterday. I want to create a new environment using a specific python version rather than leaving that to conda. Cheat-sheets and online conda documentation tell me to use: conda create -n python= like: conda cr

zipapp: add compression (method), compresslevel options from Zipfile

2025-11-09 Thread Mingye Wang via Python-list
Zipapp is meant to produce things that will be delivered to an end-user. In this way it should behave like most packaging tools and offer more "thorough" compression options, limited only by the version of the Python interpreter on the user's side (more specifically, their zipfile modules). As a

Re: argsparse: allowing --version without mandatory options

2025-11-04 Thread Jonathan N. Little via Python-list
Loris Bennett wrote: > "Loris Bennett" writes: > >> Hi, >> >> I am writing a program for the command-line which uses 'argsparse'. I >> want to make some options mandatory by setting 'required=True', but >> still allow the program to run with the option '--version' (which just >> shows the versio

Re: Formatted Integer With Specified Number Of Digits

2025-10-26 Thread Michael Torrie via Python-list
On 10/24/25 4:38 AM, Alan Bawden wrote: > Paul Rubin writes: > >Lawrence D’Oliveiro writes: >> >>> "%#0.3x" % 2 >> '0x002' > >f'0x{2:03x} > > Won't work for negative numbers. That's true. For negative numbers the padding would have to be Fs instead of 0s. -- https:/

Re: Proposal to update Unicode handling for German sharp S (ß / ẞ) in Python’s case conversion methods

2025-10-22 Thread Michael Torrie via Python-list
On 10/22/25 7:14 PM, Chris Angelico via Python-list wrote: > And that's why it's so frustrating when someone bases their entire > argument on an AI's nonsense. If the OP had simply posted it as a > request, with no hallucinated claims, it would have been a > straight-fo

Re: Proposal to update Unicode handling for German sharp S (ß / ẞ) in Python’s case conversion methods

2025-10-22 Thread Chris Angelico via Python-list
On Thu, 23 Oct 2025 at 12:01, Michael Torrie via Python-list wrote: > > On 10/19/25 12:38 PM, Chris Angelico via Python-list wrote: > > The entire premise of your post was flat-out wrong. Your data was > > nothing but hallucinations, and there is nothing to discuss. I'

Re: Proposal to update Unicode handling for German sharp S (ß / ẞ) in Python’s case conversion methods

2025-10-22 Thread Michael Torrie via Python-list
On 10/19/25 12:38 PM, Chris Angelico via Python-list wrote: > The entire premise of your post was flat-out wrong. Your data was > nothing but hallucinations, and there is nothing to discuss. I'm not > even going to bother reading further, because every post you've > writt

Re: Proposal to update Unicode handling for German sharp S (ß / ẞ) in Python’s case conversion methods

2025-10-19 Thread Chris Angelico via Python-list
On Mon, 20 Oct 2025 at 02:01, wrote: > > Thanks again for your detailed reply — I really appreciate it. I have to > admit, I wasn’t 100% sure about my data, which is why I submitted it for > discussion before opening a bug report to the Python developers. > Don't. Don't open a discussion based

Re: Proposal to update Unicode handling for German sharp S (ß / ẞ) in Python’s case conversion methods

2025-10-18 Thread Chris Angelico via Python-list
On Sun, 19 Oct 2025 at 11:03, wrote: > > Thanks Chris for the response! > > As The Unicode Standard does define an uppercase form for the German sharp S > (U+00DF → U+1E9E), and this has been part of Unicode since version 5.1 > (2008), with the German orthography officially adopting it in 2017.

Re: Slices by length

2025-10-18 Thread Rob Cliffe via Python-list
On 06/09/2025 17:21, MRAB wrote: On 2025-09-06 13:47, Rob Cliffe via Python-list wrote: I quite often find myself writing expressions of the form       someString[x : x+n] where n is often an int and x may be an int, a variable, or a (possibly complicated) expression. It would be more natural

Re: Proposal to update Unicode handling for German sharp S (ß / ẞ) in Python’s case conversion methods

2025-10-18 Thread Mashaal Al Hammdi via Python-list
Hello friends, Can I know what’s going on?! Please في سبت، 18 أكتوبر، 2025 في 7:11 ص، كتب Chris Angelico via Python-list < [email protected]>: > On Sat, 18 Oct 2025 at 13:44, wrote: > > > > Dear Python Developers, > > > > I would like to bring attenti

Re: Python 3.14.0 (final) is here!

2025-10-18 Thread Ed Leafe via Python-list
On Oct 7, 2025, at 13:14, Abdur-Rahmaan Janhangeer via Python-list wrote: > > Very sad ... At least as Steve Dower suggested even if we could get an > email from Discourse or something. I too will miss these announcements. I understand not having to post things to multiple pl

Python 3.14.0 (final) is here!

2025-10-18 Thread Hugo van Kemenade via Python-list
Note: we also announce CPython releases at https://discuss.python.org/tag/release and https://blog.python.org, and are planning on only announcing at those places in the future, and not on this mailing list. See https://discuss.python.org/t/cpython-release-announcements/103924/1 Please see https:/

Re: Python 3.14.0 (final) is here!

2025-10-18 Thread Karsten Hilbert via Python-list
Am Wed, Oct 08, 2025 at 10:51:42AM +0200 schrieb Jean-François Bachelet via Python-list: > at least a mailing list is way more frugal. and internet friendly. And above all, PUSH rather than PULL. Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https://mail.python.

Re: Slices by length

2025-10-18 Thread Rob Cliffe via Python-list
On 07/10/2025 20:37, Thomas Passin wrote: On 10/7/2025 2:49 PM, Rob Cliffe via Python-list wrote: On 06/09/2025 17:21, MRAB wrote: On 2025-09-06 13:47, Rob Cliffe via Python-list wrote: I quite often find myself writing expressions of the form       someString[x : x+n] where n is often an

Re: Proposal to update Unicode handling for German sharp S (ß / ẞ) in Python’s case conversion methods

2025-10-17 Thread Chris Angelico via Python-list
On Sat, 18 Oct 2025 at 13:44, wrote: > > Dear Python Developers, > > I would like to bring attention to an inconsistency and legacy behavior > regarding the handling of the German sharp S characters in Python’s string > case conversion methods. > This isn't Python's decision. The definition of

Re: Python 3.14.0 (final) is here!

2025-10-17 Thread Jean-François Bachelet via Python-list
Le 07/10/2025 à 20:14, Abdur-Rahmaan Janhangeer via Python-list a écrit : Very sad ... At least as Steve Dower suggested even if we could get an email from Discourse or something. Kind Regards, Abdur-Rahmaan Janhangeer about <https://compileralchemy.github.io/> |

Re: Slices by length

2025-10-08 Thread meowxiik via Python-list
> Which brings to mind a possible alternate syntax: s[x::n] This would AFAIK collide with the the x[a:b:c] syntax, which already means something, the c is the size of a step <https://docs.python.org/3/library/functions.html#slice> M On 8 October 2025 16:22:46 CEST, python-

Re: Python 3.14.0 (final) is here!

2025-10-07 Thread Abdur-Rahmaan Janhangeer via Python-list
Mauritius On Tue, Oct 7, 2025 at 8:06 PM Hugo van Kemenade via Python-list < [email protected]> wrote: > Note: we also announce CPython releases at > https://discuss.python.org/tag/release and https://blog.python.org, and > are planning on only announcing at those places

Re: Detailed documentation or specs for behavior of descriptors in attributes of metaclasses

2025-09-26 Thread Steve Jorgensen via Python-list
In case anyone stumbles upon this, here's my question and partial self-answer on Stack Overflow: https://stackoverflow.com/a/79765602/396373 -- https://mail.python.org/mailman3//lists/python-list.python.org

concurrent.interpreters: why syntax errors in exec() cause a SyntaxError instead of an InterpreterError?

2025-09-25 Thread a.mux--- via Python-list
Hi, I am testing the [concurrent.interpreters](https://docs.python.org/3.14/library/concurrent.interpreters.html) feature from Python **3.14rc3** (the latest current rc). The subinterpreter seems to behave in a surprising way when encountering syntax errors. For example, in the following code:

Help Needed to Run Python.NET Demo Samples in C#

2025-09-23 Thread vitarag shah via Python-list
I need your help regarding how to run Python.NET demo samples (C:\Program Files\PythonNet\demo) in C#. Best Regards, Vitarag Shah | Senior SEO Analyst Azilen Technologies 📞 USA Phone Number: +1 (989) 287-9400 📞 EU Phone Number: +41 44 586 22 72 ✉️ Business Inquiries: [email protected] 🌐 Website:

Python 3.14.0rc3 is go! And release announcement news

2025-09-22 Thread Hugo van Kemenade via Python-list
Note: we also announce CPython releases at https://discuss.python.org/tag/release and https://blog.python.org, and are planning on only announcing at those places in the future, and not on this mailing list. Please see https://discuss.python.org/t/python-3-14-0rc3-is-go/103815 for the 3.14.0rc3 re

Re: Test message. Posted a question several days ago and don't see it.

2025-09-12 Thread Steve Jorgensen via Python-list
Well, that was the more important thing to do. :) -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: Test message. Posted a question several days ago and don't see it.

2025-09-10 Thread dn via Python-list
Hi Steve, ask away... On 11/09/25 16:15, Steve Jorgensen via Python-list wrote: I posted a question here several days ago and received a "Welcome to the "Python-list" mailing list!" email, but I still don't see my question in the list. I'm posting this mainly to

Re: Drop into REPL when your program crashes.

2025-09-10 Thread Annada Behera via Python-list
So, ipdb is the ipython version of pdb. In fact, post_mortem is a pdb function. I use ipdb because its REPL is a bit nicer to work with then pdb. -Original Message- From: Stefan Ram Subject: Re: Drop into REPL when your program crashes. Date: 09/08/2025 06:04:16 PM Newsgroups: comp.lang.p

Drop into REPL when your program crashes.

2025-09-10 Thread Annada Behera via Python-list
Hi, Recently I have been increasingly adding this piece of code as a preamble to a lot of my code. import (sys, os, ipdb) def debug_hook(exc_type, exc_value, traceback): if exc_type is KeyboardInterrupt: sys.__excepthook__(exc_type, exc_value, traceback) r

Detailed documentation or specs for behavior of descriptors in attributes of metaclasses

2025-09-10 Thread Steve Jorgensen via Python-list
I've been experimenting to deepen my understanding of Python's behavior in regard to metaclasses, descriptors, and other meta-programming stuff. In the process, I have come across a behavior that is presumably by design but cannot be inferred from anything I can find in the official documentatio

Test message. Posted a question several days ago and don't see it.

2025-09-10 Thread Steve Jorgensen via Python-list
I posted a question here several days ago and received a "Welcome to the "Python-list" mailing list!" email, but I still don't see my question in the list. I'm posting this mainly to see if it shows up, or I get a reply from a moderator, or something like tha

Re: Slices by length

2025-09-06 Thread dn via Python-list
On 7/09/25 00:47, Rob Cliffe via Python-list wrote: I quite often find myself writing expressions of the form     someString[x : x+n] where n is often an int and x may be an int, a variable, or a (possibly complicated) expression. 0 A PEP 1 A helper-function eg slice_by_length

Slices by length

2025-09-06 Thread Rob Cliffe via Python-list
I quite often find myself writing expressions of the form     someString[x : x+n] where n is often an int and x may be an int, a variable, or a (possibly complicated) expression. It would be more natural to be able to specify the slice not by its startpoint and ENDPOINT, but by its startpoint an

Re: Error installing matplotlib

2025-09-05 Thread Rob Cliffe via Python-list
On 03/09/2025 15:45, Oscar Benjamin wrote: On Wed, 3 Sep 2025, 15:40 Rob Cliffe, wrote: On 03/09/2025 15:35, Oscar Benjamin wrote: On Wed, 3 Sep 2025, 15:21 Rob Cliffe via Python-list, wrote: On 03/09/2025 14:59, Mats Wichmann wrote: > On 9/3/25 07

Python Installation -- configure flags

2025-09-05 Thread Klaus Jantzen via Python-list
I have not installed python for a long time so I am not sure whether the following configure flags are sufficient/recommandable for a Python3.12.11 installation. --prefix=/opt --with-lto --enable-optimizations --enable-loadable-sqlite-extensions --with-ensurepip=install --with-pydebug --with-as

Re: Environments and Version Control (if not packaging and PyPI)

2025-09-04 Thread Left Right via Python-list
I tried uv, and I don't see a point in using it. It does what some other existing tools do. Maybe faster. But it's in the place where speed is not important. For work, I follow company's rules, which require setting up a project in the company's Git server. It doesn't really matter in what order t

Environments and Version Control (if not packaging and PyPI)

2025-09-04 Thread dn via Python-list
How do you start (and thus run) a Python project? tldr; question in last paragraph Two articles appeared in my InTray: - Reuven Lerner (Python Trainer) saying "You’re probably using uv wrong" (https://lerner.co.il/2025/08/28/youre-probably-using-uv-wrong/), NB adapted from [his] “Better develo

Re: Image enhance

2025-09-03 Thread AM CR via Python-list
7;d appreciate it if someone could advise me on which version of Python is recommended for that operating system. Thank you very much. Arodri Thomas Passin escreveu (terça, 2/09/2025 à(s) 23:24): > On 9/2/2025 11:29 AM, amrodi--- via Python-list wrote: > > I'm new to Python. >

Re: Error installing matplotlib

2025-09-03 Thread Left Right via Python-list
"pip install ./matplotlib-3.9.2-cp313-cp313-win_amd64.whl". You will probably get an error, and hopefully, the error message will give you some idea about why it couldn't install this in your initial attempt. On Tue, Sep 2, 2025 at 11:00 PM Rob Cliffe via Python-list wrote: > > He

Re: Error installing matplotlib

2025-09-03 Thread Oscar Benjamin via Python-list
On Wed, 3 Sep 2025, 15:40 Rob Cliffe, wrote: > > > On 03/09/2025 15:35, Oscar Benjamin wrote: > > > > On Wed, 3 Sep 2025, 15:21 Rob Cliffe via Python-list, < > [email protected]> wrote: > >> >> >> On 03/09/2025 14:59, Mats Wic

Re: Error installing matplotlib

2025-09-03 Thread Rob Cliffe via Python-list
On 03/09/2025 15:35, Oscar Benjamin wrote: On Wed, 3 Sep 2025, 15:21 Rob Cliffe via Python-list, wrote: On 03/09/2025 14:59, Mats Wichmann wrote: > On 9/3/25 07:20, Rob Cliffe wrote: >> >> >> On 03/09/2025 00:01, Mats Wichmann wrote: >

Re: Error installing matplotlib

2025-09-03 Thread Oscar Benjamin via Python-list
On Wed, 3 Sep 2025, 15:21 Rob Cliffe via Python-list, < [email protected]> wrote: > > > On 03/09/2025 14:59, Mats Wichmann wrote: > > On 9/3/25 07:20, Rob Cliffe wrote: > >> > >> > >> On 03/09/2025 00:01, Mats Wichmann wrote: > &g

Re: Error installing matplotlib

2025-09-03 Thread Rob Cliffe via Python-list
On 03/09/2025 14:59, Mats Wichmann wrote: On 9/3/25 07:20, Rob Cliffe wrote: On 03/09/2025 00:01, Mats Wichmann wrote: On 9/2/25 14:51, Rob Cliffe via Python-list wrote: There are two roots here: (1) it's not finding a prebuilt wheel.  You can see that because it's propos

Re: Error installing matplotlib

2025-09-03 Thread Rob Cliffe via Python-list
On 03/09/2025 00:01, Mats Wichmann wrote: On 9/2/25 14:51, Rob Cliffe via Python-list wrote: There are two roots here: (1) it's not finding a prebuilt wheel.  You can see that because it's proposing to use the source distribution instead: > Collecting matplotlib >

Re: Image enhance

2025-09-03 Thread Joel Goldstick via Python-list
On Tue, Sep 2, 2025 at 1:46 PM amrodi--- via Python-list wrote: > > I'm new to Python. > Operating System - Windows XP SP3 > Python 2.7 installed. > > I got a script that tries to improve the image? > I created a bat file using the command line. > > C:\pyth

Error installing matplotlib

2025-09-02 Thread Rob Cliffe via Python-list
Hello, can anyone help?  All assistance gratefully received.  I am running python 3.13.3 on a Windows 11 machine and trying to do     pip install matplotlib (No, I don't need to say "python -m ...", I am running the right version of python.exe.) This starts by generating the following output (wh

Re: Access to return / exception context in finally block

2025-09-02 Thread marius.spix--- via Python-list
>def f(x): > try: > quot = 10 / x > except ZeroDivisionError as exc: > log_error(exc) > return 0 > else: > log_return(quot) > return quot + 1 > finally: > "Any cleanup processing needed before returning" This involves defining the new

Re: Image enhance

2025-09-02 Thread amrodi9999--- via Python-list
My code from PIL import Image, ImageEnhance import matplotlib.pyplot as plt import numpy as np import cv2 # Original image path image_path = "D:\temp\STC.jpg" # Altere se estiver em outro local original_image = Image.open(image_path) # Convert to OpenCV to apply enhancements cv_image = cv2.cvtC

Image enhance

2025-09-02 Thread amrodi9999--- via Python-list
I'm new to Python. Operating System - Windows XP SP3 Python 2.7 installed. I got a script that tries to improve the image? I created a bat file using the command line. C:\python27\python.exe d:\temp\teste.py But even though it runs, it displays an error: "... no encoding declare..." Can anyone

Re: Access to return / exception context in finally block

2025-09-01 Thread Rob Cliffe via Python-list
On 01/09/2025 14:26, marius.spix--- via Python-list wrote: In your example when would isinstance(__exit_context__, ReturnContext) be True and when would it be False? What would __exit_context__.value be? I can't think of a sensible meaning for it. If no exception occurs, is the value ret

Re: Access to return / exception context in finally block

2025-09-01 Thread Rob Cliffe via Python-list
On 01/09/2025 14:26, marius.spix--- via Python-list wrote: In your example when would isinstance(__exit_context__, ReturnContext) be True and when would it be False? What would __exit_context__.value be? I can't think of a sensible meaning for it. If no exception occurs, is the value ret

Re: Access to return / exception context in finally block

2025-09-01 Thread marius.spix--- via Python-list
>In your example when would isinstance(__exit_context__, ReturnContext) >be True and when would it be False? What would __exit_context__.value >be? I can't think of a sensible meaning for it. If no exception occurs, >is the value returned by f supposed to be 10/x or __exit_context__.value >+ 1

Re: Python documentary

2025-09-01 Thread Schimon Jehudah via Python-list
clothes. I despise those subtle advertisements. Kind regards, Schimon On Fri, 29 Aug 2025 12:19:24 -0700 Larry Martell via Python-list wrote: > https://www.youtube.com/watch?v=GfH4QL4VqJ0 > > Watched this last night. Overall I enjoyed it (but my wife, who is > not a programmer, fell

Re: Access to return / exception context in finally block

2025-09-01 Thread Left Right via Python-list
Well, this is the classic example of reinventing Lisp. But why do it incrementally and in this ridiculously inconvenient way? For those unaware of the history: https://gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts this is an informal explanation of the mechanism. Better ye

Re: Access to return / exception context in finally block

2025-08-31 Thread Rob Cliffe via Python-list
On 30/08/2025 12:03, marius.spix--- via Python-list wrote: Dear mailing list, there is currently no direct way to observe the current interpreter state in a finally block without tracing. My idea is introducing an immutable __exit_context__ magic variable, which would have one of three

Access to return / exception context in finally block

2025-08-30 Thread marius.spix--- via Python-list
Dear mailing list, there is currently no direct way to observe the current interpreter state in a finally block without tracing. My idea is introducing an immutable __exit_context__ magic variable, which would have one of three possible values: * ReturnContext(value), if a return statement is

Re: Python documentary

2025-08-30 Thread Left Right via Python-list
> Had this 'live-test' failed, where would Python be today? I'm not sure if this is irony or do you honestly believe it succeeded... but I think that "where Python is today" is pretty indicative of failure. To me, however, the failure started with the whole Python 3.X project, Guido being forced i

Re: Python documentary

2025-08-29 Thread Tim Williams via Python-list
On Fri, Aug 29, 2025 at 3:37 PM Larry Martell via Python-list < [email protected]> wrote: > https://www.youtube.com/watch?v=GfH4QL4VqJ0 > > Watched this last night. Overall I enjoyed it (but my wife, who is not a > programmer, fell asleep). My only quibble is that they s

Re: Python documentary

2025-08-29 Thread dn via Python-list
To you (if apparently in-reply to the OP), On 30/08/25 07:19, Larry Martell via Python-list wrote: https://www.youtube.com/watch?v=GfH4QL4VqJ0 Watched this last night. Overall I enjoyed it (but my wife, who is not a programmer, fell asleep). My only quibble is that they spent too much time

Python documentary

2025-08-29 Thread Larry Martell via Python-list
https://www.youtube.com/watch?v=GfH4QL4VqJ0 Watched this last night. Overall I enjoyed it (but my wife, who is not a programmer, fell asleep). My only quibble is that they spent too much time talking about the walrus controversy. -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: can you improve this text-only beginner copy program?

2025-08-28 Thread dn via Python-list
PS Ethan: way-down the docs you'll find two very handy methods worth applying as a second-attempt at this challenge! On 28/08/25 03:41, Chris Angelico via Python-list wrote: On Thu, 28 Aug 2025 at 01:28, Ethan Carter wrote: def copy(s, d): """Copies text fil

Re: can you improve this text-only beginner copy program?

2025-08-28 Thread dn via Python-list
On 29/08/25 10:52, Grant Edwards via Python-list wrote: On 2025-08-28, Mark Bourne wrote: Ethan Carter wrote: PS. Is it just me or there's just us in this used-to-be-very-active group? Thanks for being my teacher here. Have a good day! Until a few months ago, there was a gateway

Re: can you improve this text-only beginner copy program?

2025-08-28 Thread Grant Edwards via Python-list
On 2025-08-28, Mark Bourne wrote: > Ethan Carter wrote: >> PS. Is it just me or there's just us in this used-to-be-very-active >> group? Thanks for being my teacher here. Have a good day! >> > > Until a few months ago, there was a gateway that forwarded messages both > ways between this newsg

Re: can you improve this text-only beginner copy program?

2025-08-28 Thread Grant Edwards via Python-list
On 2025-08-28, Roel Schroeven wrote: >> If an OS did let you delete an open file, how would you expect it to >> behave? Would you still be able to use the file? Would the file be >> marked for deletion and be deleted when it was finally closed? > Unix-like operating systems do let you delete a

Re: can you improve this text-only beginner copy program?

2025-08-27 Thread Grant Edwards via Python-list
On 2025-08-27, Chris Angelico via Python-list wrote: > On Thu, 28 Aug 2025 at 01:28, Ethan Carter wrote: >> def copy(s, d): >> """Copies text file named S to text file named D.""" >> with open(s) as src: >> with open(d,

Re: can you improve this text-only beginner copy program?

2025-08-27 Thread Chris Angelico via Python-list
On Thu, 28 Aug 2025 at 01:28, Ethan Carter wrote: > def copy(s, d): > """Copies text file named S to text file named D.""" > with open(s) as src: > with open(d, "w") as dst: > try: > dst.write(src.read()) > except Exception: > os.remove(d) > raise > In

PyPi mirrors

2025-08-24 Thread dn via Python-list
Hi, Do you use a mirror in front of the PyPi "Cheese Shop"? - perhaps a server like DevPi or Bandersnatch? - perhaps a personal interest or your enterprise? - is there public instance such as unis and others mirroring Linux distros? -- Regards, =dn -- https://mail.python.org/mailman3//lists/pyt

entanglement.py: New tool for calling C++ symbols directly from Python using the C++ABI

2025-08-22 Thread Adrian Johnston via Python-list
Hello, I recently hacked together a script called entanglement.py that uses libclang to parse C++ headers and generate a Python wrapper that can call the C++ symbols in a .so directly. The Itanium C++ ABI is easy enough to call from ctypes with 1 exception. Returning a class by value from C++ resu

the ordering problem using multiprocessing.Queue with multiple processes

2025-08-11 Thread Li Li via Python-list
I am using multiprocessing.Queue to implement classic producer-consumer pattern. To let consumers know all the tasks are done. I use a special None as sentinel. And I use Lock and Value(counter) to judge if current process is the last producer. If it is the last producer, it will put as many None a

Re: Searching for a file

2025-08-05 Thread Grant Edwards via Python-list
On 2025-08-05, Michael Torrie via Python-list wrote: > On 5/24/25 7:19 PM, Chris Angelico via Python-list wrote: >> On Sun, 25 May 2025 at 10:05, Rob Cliffe via Python-list >> wrote: >>> Yes, but if I understand correctly, they all start from a single >>>

Re: Searching for a file

2025-08-04 Thread Michael Torrie via Python-list
On 5/24/25 7:19 PM, Chris Angelico via Python-list wrote: > On Sun, 25 May 2025 at 10:05, Rob Cliffe via Python-list > wrote: >> Yes, but if I understand correctly, they all start from a single >> directory (and work downwards if required). >> My suggestion involved sear

Python 3.14 release candidate 1 is go!

2025-07-22 Thread Hugo van Kemenade via Python-list
It’s the first 3.14 release candidate! https://www.python.org/downloads/release/python-3140rc1/ This release, 3.14.0rc1, is the penultimate release preview. Entering the release candidate phase, only reviewed code changes which are clear bug fixes are allowed between this release candidate and th

Announcement: distlib 0.4.0 released on PyPI

2025-07-17 Thread Vinay Sajip via Python-list
Version 0.4.0 of distlib has recently been released on PyPI [1]. For newcomers, distlib is a library of packaging functionality which is intended to be usable as the basis for third-party packaging tools. The main changes in this release are as follows: * Add the ``interpret_parsed`` function t

Assignment of global variables in a script.

2025-06-30 Thread Popov, Dmitry Yu via Python-list
Dear Sirs. I found the following sentence in the Python documentation: "The statements executed by the top-level invocation of the interpreter, either read from a script file or interactively, are considered part of a module called __main__

configparser get non-existent boolean

2025-06-30 Thread Rob Cliffe via Python-list
I was surprised to find that in configparser, getboolean() does not raise KeyError for a non-existent config parameter. Demo program (Python 3.11.5, Windows 11): import configparser config = configparser.ConfigParser() config.read('ThisFileDoesNotExist.ini') # This line could be removed MY_BOOL

Optimising constant expressions

2025-06-26 Thread Rob Cliffe via Python-list
I am using Python 3.13.3 on Windows 11. I notice that the compiler can optimise (some) constant expressions containing operators plus numbers or strings, e.g.     2+2 is compiled as 4     1 + (2.5 + 3+4j) is compiled as 6.5+4j     'a' + 'b' is compiled as 'ab'     and even 'a'*4096 is compiled a

Re: What does stats = await asyncio.to_thread(os.stat, url) do? (Was async I/O via threads is extremly slow)

2025-06-23 Thread Inada Naoki via Python-list
Other languages uses thread pool, instead of creating new thread. In Python,loop.run_in_executor uses thread pool. https://docs.python.org/3.13/library/asyncio-eventloop.html#asyncio.loop.run_in_executor 2025年6月24日(火) 8:12 Mild Shock : > > So what does: > > stats = await asyncio.to_thread(os.sta

Re: async I/O via threads is extremly slow (Was: Does Python Need Virtual Threads?)

2025-06-23 Thread Left Right via Python-list
I honestly have no idea what's being measured, but here are some numbers to compare this to, and then some explanation about async I/O in general. 1. No I/O to a local disk on a modern controller should take milliseconds. The time you are aiming for is below millisecond. That is, writing a block t

Runtime detection of PEP 563

2025-06-22 Thread Ian Pilcher via Python-list
Given a class object (C), is it possible to *reliably* determine whether the class was compiled with PEP 563 (from __future__ import annotations) enabled? Note that simply looking for the presence of C.__module__.annotations is not really reliable. It will fail in the presence of any of these co

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-18 Thread Omar Ahmed via Python-list
The solution was provided in this thread here: https://discuss.python.org/t/extended-import-syntax-for-aliasing-module-attributes/95920/3 The correct way to implement is: import module from module import optimize, validate as check -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-18 Thread Omar Ahmed via Python-list
Thank you. I have used this link. I had difficulty finding it. https://discuss.python.org/ -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-18 Thread Omar Ahmed via Python-list
Thank you. I have posted this idea on https://discuss.python.org/c/ideas/6 I had difficulty trying to find that. -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: Matplotlib "collections" module in recent Python, Matplotlib

2025-06-18 Thread jmhannon.ucdavis--- via Python-list
Thanks, D'Arcy. I've done a fair amount of 2-to-3 migration in the past, but there was a lot of stuff in that article ("six", for instance) that I hadn't run across. -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: Matplotlib "collections" module in recent Python, Matplotlib

2025-06-18 Thread jmhannon.ucdavis--- via Python-list
Thanks. That appears to be exactly the thing I was looking for (vis-a-vis collections). -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-18 Thread Abdur-Rahmaan Janhangeer via Python-list
wrote: > > > > On 17 Jun 2025, at 00:19, Omar Ahmed via Python-list < > [email protected]> wrote: > > > > Hi all, > > I would like to propose a potential addition to Python's `import` syntax > that would improve clarity and ergonomics for cases wh

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-17 Thread Neal Becker via Python-list
On Tue, Jun 17, 2025 at 8:19 AM Barry Scott wrote: > > > > On 17 Jun 2025, at 00:19, Omar Ahmed via Python-list < > [email protected]> wrote: > > > > Hi all, > > I would like to propose a potential addition to Python's `import` syntax > that

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-16 Thread Rob Cliffe via Python-list
On 17/06/2025 00:19, Omar Ahmed via Python-list wrote: Hi all, I would like to propose a potential addition to Python's `import` syntax that would improve clarity and ergonomics for cases where developers want both full module access *and* a local alias to a specific attribute within

PEP Idea: Extended import syntax for aliasing module attributes

2025-06-16 Thread Omar Ahmed via Python-list
Hi all, I would like to propose a potential addition to Python's `import` syntax that would improve clarity and ergonomics for cases where developers want both full module access *and* a local alias to a specific attribute within that module. Currently, to get both behaviors, we typically write:

Matplotlib "collections" module in recent Python, Matplotlib

2025-06-16 Thread jmhannon.ucdavis--- via Python-list
Greetings. We (the group that I work with) have "inherited" some Python scripts that were written years ago, using Python 2. We're trying to upgrade the scripts so that they work in our current environment: OS: Ubuntu 24.04.2 LTS $ python --version Python 3.11.13 >>> ma

Feedback & Discussion: Magic Wormhole 0.19.0 Release Updates

2025-06-03 Thread MyMilestone Card via Python-list
Hi everyone, I just read the release announcement for Magic Wormhole 0.19.0, and I wanted to start a thread here to appreciate the work and open up discussion for anyone using or interested in it. Some exciting highlights: New status feedback API, finally, some clean visibility into code consumpt

Re: magic-wormhole 0.19.0

2025-06-01 Thread MyMilestone Card via Python-list
Thanks for sharing the update, Meejah! Great to see the addition of the status feedback API and improved Dilation handling, those changes should definitely enhance usability and performance. Also appreciate the move to pytest and the clearer packaging per PEP 625. Solid work! -- https://mail.py

Re: Python tutor mailing list?

2025-05-28 Thread Marc Nicole via Python-list
Being a user of that list i've also noticed that only recently. hope that this list is good enough to take on all python questions. Are there any other alternative lists? Thx On Wed, 28 May 2025, 01:35 Alan Gauld via Python-list, < [email protected]> wrote: > I am the mo

Re: Searching for a file

2025-05-28 Thread Roland Mueller via Python-list
ke 28.5.2025 klo 1.45 Thomas Passin ([email protected]) kirjoitti: > On 5/27/2025 10:41 AM, Roland Mueller via Python-list wrote: > > To get a list of files in a given directory one can use glob.glob and > > The OP had a different problem. He wanted to find a config file of &g

Re: Python tutor mailing list?

2025-05-27 Thread dn via Python-list
Message received! Hope you enjoyed your holiday... On 28/05/25 12:00, Alan Gauld via Python-list wrote: On 28/05/2025 00:32, Alan Gauld via Python-list wrote: The archives are still there and the sign-up page seems to work, but it doesn't recognise me. I tried signing up as a new m

Re: Python tutor mailing list?

2025-05-27 Thread Alan Gauld via Python-list
On 28/05/2025 00:32, Alan Gauld via Python-list wrote: > The archives are still there and the sign-up page seems to > work, but it doesn't recognise me. I tried signing up as > a new member with a different address and that seems to work(ie no > errors) but I still don;t see any

Python tutor mailing list?

2025-05-27 Thread Alan Gauld via Python-list
I am the moderator of the python tutor mailing list. Or at least I was. It seems the tutor list has been deleted. I came back from vacation to find that I can't access it. Nobody told me anything in advance. I've tried emailing postmaster but got no response. I wonder if anyone here has any idea

Re: Searching for a file

2025-05-27 Thread Roland Mueller via Python-list
he parts for the glob mask together instead of plain '/'. > > > ti 27.5.2025 klo 17.05 Peter J. Holzer ([email protected]) kirjoitti: > >> On 2025-05-24 17:18:11 -0600, Mats Wichmann wrote: >> > On 5/23/25 16:05, Rob Cliffe via Python-list wrote: >> &g

  1   2   3   4   5   6   7   8   9   10   >