Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2024-01-14 Thread Mike Dewhirst via Python-list
In Windows the provided methods for running complex command lines are either a batch file or a shortcut.Someone very kindly pointed out to me in this thread that there is a PEP for py.exe. I don't use py.exe originally because I didn't trust it believing it was a new-fangled Microsoft trick. I

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-29 Thread Mike Dewhirst via Python-list
On 29/12/2023 12:09 pm, Félix An via Python-list wrote: On 2023-12-25 12:36, Mike Dewhirst wrote: 3. You cannot trust Microsoft. You can trust Python Software Foundation. Python from PSF works the same in all environments - or if not it is a bug. Python from Microsoft is tweaked to satisfy

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-25 Thread Mike Dewhirst via Python-list
-list Subject: Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more On Mon, 25 Dec 2023 at 15:42, Mike Dewhirst via Python-list wrote:>> Apologies for top posting - my phone seems unable to do otherwise.>> Here's my view - which may not be po

Re: Python 3.12.1, Windows 11: shebang line #!/usr/bin/env python3 doesn't work any more

2023-12-24 Thread Mike Dewhirst via Python-list
Apologies for top posting - my phone seems unable to do otherwise. Here's my view - which may not be popular. 1. Py.exe is an awful idea. 2. Installing python in %PROGRAMFILES% is not a good idea 3. Installing Python from a Microsoft shop or server is a bad idea 4. Shebang lines are pretty

Re: Code improvement question

2023-11-16 Thread Mike Dewhirst via Python-list
On 16/11/2023 9:34 am, Rimu Atkinson via Python-list wrote: Why don't you use re.findall? re.findall(r'\b[0-9]{2,7}-[0-9]{2}-[0-9]{2}\b', txt) I think I can see what you did there but it won't make sense to me - or whoever looks at the code - in future. That answers your specific

Re: Code improvement question

2023-11-16 Thread Mike Dewhirst via Python-list
On 15/11/2023 3:08 pm, MRAB via Python-list wrote: On 2023-11-15 03:41, Mike Dewhirst via Python-list wrote: On 15/11/2023 10:25 am, MRAB via Python-list wrote: On 2023-11-14 23:14, Mike Dewhirst via Python-list wrote: I'd like to improve the code below, which works. It feels clunky to me

Re: Code improvement question

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

Code improvement question

2023-11-14 Thread Mike Dewhirst via Python-list
I'd like to improve the code below, which works. It feels clunky to me. I need to clean up user-uploaded files the size of which I don't know in advance. After cleaning they might be as big as 1Mb but that would be super rare. Perhaps only for testing. I'm extracting CAS numbers and here

Re: Help

2023-11-07 Thread Mike Dewhirst via Python-list
On 7/11/2023 9:02 am, Jason Friedman via Python-list wrote: On Sun, Nov 5, 2023 at 1:23 PM office officce via Python-list < python-list@python.org> wrote: which python version is better to be used and how to make sure it works on my window 10 because i downloaded it and it never worked so I

Re: Checking if email is valid

2023-11-02 Thread Mike Dewhirst via Python-list
If i wanted an email verifier I would look at open source frameworks and see how they do it. Django comes to mind.--(Unsigned mail from my phone) Original message From: Michael Torrie via Python-list Date: 3/11/23 07:23 (GMT+10:00) To: python-list@python.org Subject: Re:

RE: regarding installation of python version

2023-10-09 Thread Mike Dewhirst via Python-list
Look in Windows Settings, About, Advanced system settings, Environment variables and you will see two sets of variables. One for the system and one set for yourself.Select Path and click [Edit]Carefully remove all references to Python in both sets.In theory you can now install a new Python and

zoneinfo and tzdata

2023-08-09 Thread Mike Dewhirst via Python-list
The zoneinfo module does not work on Windows unless you have installed tzdata. On Ubuntu that data seems to exist already. Not sure how or why but it obviously isn't there in a Windows virtualenv unless deliberately installed. I just spent a bit of time trying to switch from pytz to zoneinfo

Re: Isn't TypeError built in?

2021-12-25 Thread Mike Dewhirst via Python-list
TypeError built in? On 2021-12-13 12:22:28 +1100, Mike Dewhirst via Python-list wrote:> Obviously something is wrong elsewhere but I'm not sure where to look.> Ubuntu 20.04 with plenty of RAM.[...]> [Mon Dec 13 01:15:49.885659 2021] [mpm_event:notice] [pid 1033:tid> 140446449658944]

Re: Isn't TypeError built in?

2021-12-13 Thread Mike Dewhirst via Python-list
On 13/12/2021 12:42 pm, Chris Angelico wrote: On Mon, Dec 13, 2021 at 12:31 PM Mike Dewhirst via Python-list wrote: Obviously something is wrong elsewhere but I'm not sure where to look. Ubuntu 20.04 with plenty of RAM. def __del__(self): try: for context_obj

Isn't TypeError built in?

2021-12-12 Thread Mike Dewhirst via Python-list
Obviously something is wrong elsewhere but I'm not sure where to look. Ubuntu 20.04 with plenty of RAM.     def __del__(self):     try:     for context_obj in self._context_refs:     try:     delattr(context_obj, self._attr_name)     except

pythonpapers.org domain name to lapse in November

2021-10-04 Thread Mike Dewhirst via Python-list
The board of editors of the Python Papers has decided to let the pythonpapers.org domain name to lapse. It will not be renewed in November. Anyone interested in it can get in touch. Cheers Mike -- Signed email is an absolute defence against phishing. This email has been signed with my

Re: XML Considered Harmful

2021-09-24 Thread Mike Dewhirst via Python-list
I had to use XML once because that was demanded by the receiving machine over which I had no say.I wouldn't use it otherwise because staring at it makes you dizzy.I would want to know how the data are derived from the multiple sources and transmitted to the collating platform before