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 the problem. Recent

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/timeout-d

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 help for solving this problem

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 like

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 datacla

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. > > > from tkinter import * > from tkinter.ttk

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 return. So what's happ

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 said it: When you enter t

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 example (I'm

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.3:f3909b8, Apr

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

2023-10-02 Thread MRAB via Python-list
On 2023-10-01 23:04, 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= bytes((len(qs_array)) * 8)

Re: PyInstaller value error: Invalid Windows resource specifier

2023-10-30 Thread MRAB via Python-list
On 2023-10-30 19:19, McDermott Family via Python-list wrote: Hello, I am trying to create a one file executable with pyinstaller 6.1.0 and auto-py-to-exe 2.41.0 using Python version 3.10.9 in a virtual environment. Some points before the output of pinstaller is shown. My resource .py file is the

Re: Checking if email is valid

2023-11-06 Thread MRAB via Python-list
On 2023-11-06 08:57, Simon Connah via Python-list wrote: I can see how the truley dim-witted might forget that other countries have phone numbers with differing lengths and formatting/punctuation, but there are tons of sites where it takes multiple tries when entering even a bog-standard USA 10

Re: Writing to clipboard in Python 3.11

2023-11-07 Thread MRAB via Python-list
On 2023-11-06 00:51, Rob Cliffe via Python-list wrote: Recently I switched from Python 3.8.3 to Python 3.11.4.  A strange problem appeared which was not there before: I am using the win32clipboard backage (part of pywin32), and when I use SetClipboardData() to write text which consists ENTIRELY O

Re: fCONV_AUSRICHTG is not defined - Why?

2023-11-07 Thread MRAB via Python-list
On 2023-11-07 18:30, dn via Python-list wrote: On 08/11/2023 06.47, Egon Frerich via Python-list wrote: I've no idea why this happens. In a module there are lists and definitions: ...     ["%s%s%s " % (i[fCONV_AUSRICHTG], i[fLG2], i[fTYP]) for i in Felder])   File "/home/egon/Entw/Geldspur/

Re: fCONV_AUSRICHTG is not defined - Why?

2023-11-07 Thread MRAB via Python-list
On 2023-11-07 19:20, Jim Schwartz via Python-list wrote: Where do you define fCONV_AUSRICHTG? It must be initialized or defined somewhere. Did you leave out a statement from the python 2 version? It's given its value here: ( fNAME, fLG1, fLG2, fTYP,

Re: fCONV_AUSRICHTG is not defined - Why?

2023-11-07 Thread MRAB via Python-list
On 2023-11-07 20:56, Thomas Passin via Python-list wrote: On 11/7/2023 3:29 PM, MRAB via Python-list wrote: On 2023-11-07 19:20, Jim Schwartz via Python-list wrote: Where do you define fCONV_AUSRICHTG? It must be initialized or defined somewhere. Did you leave out a statement from the python 2

Re: Beep on WIndows 11

2023-11-12 Thread MRAB via Python-list
On 2023-11-12 11:16, Chris Angelico via Python-list wrote: On Sun, 12 Nov 2023 at 21:27, Y Y via Python-list wrote: I am curious and humble to ask: What is the purpose of a BEEP? There are several purposes. I can't say which of these are relevant to the OP, but some or all of them could eas

Re: xor operator

2023-11-13 Thread MRAB via Python-list
On 2023-11-13 21:03, Barry via Python-list wrote: On 13 Nov 2023, at 17:48, Dom Grigonis wrote: Short circuiting happens, when: xor([True, True, False, False], n=1) At index 1 it is clear that the answer is false. Can you share an example with 4 values that is true? And explain why it is x

Re: Code improvement question

2023-11-14 Thread MRAB via Python-list
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 be as big as 1Mb but that would be super rare. Perhaps on

Re: Code improvement question

2023-11-14 Thread MRAB via Python-list
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. I need to clean up user-uploaded files the si

Re: Code improvement question

2023-11-16 Thread MRAB via Python-list
On 2023-11-17 01:15, Mike Dewhirst via Python-list wrote: 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 li

Re: Code improvement question

2023-11-17 Thread MRAB via Python-list
On 2023-11-17 09:38, jak via Python-list wrote: Mike Dewhirst ha scritto: 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-upl

Re: How/where to store calibration values - written by program A, read by program B

2023-12-05 Thread MRAB via Python-list
On 2023-12-05 14:37, Chris Green via Python-list wrote: Is there a neat, pythonic way to store values which are 'sometimes' changed? My particular case at the moment is calibration values for ADC inputs which are set by running a calibration program and used by lots of programs which display the

Re: How/where to store calibration values - written by program A, read by program B

2023-12-06 Thread MRAB via Python-list
On 2023-12-06 12:23, Thomas Passin via Python-list wrote: On 12/6/2023 6:35 AM, Barry Scott via Python-list wrote: On 6 Dec 2023, at 09:32, Chris Green via Python-list wrote: My requirement is *slightly* more complex than just key value pairs, it has one level of hierarchy, e.g.:- KEY

Re: How/where to store calibration values - written by program A, read by program B

2023-12-06 Thread MRAB via Python-list
On 2023-12-06 20:11, dn via Python-list wrote: On 7/12/23 07:12, MRAB via Python-list wrote: On 2023-12-06 12:23, Thomas Passin via Python-list wrote: On 12/6/2023 6:35 AM, Barry Scott via Python-list wrote: On 6 Dec 2023, at 09:32, Chris Green via Python-list wrote: My requirement is

Re: How to enter multiple, similar, dictionaries?

2023-12-11 Thread MRAB via Python-list
On 2023-12-11 15:57, Chris Green via Python-list wrote: Chris Green wrote: Is there a way to abbreviate the following code somehow? lv = {'dev':'bbb', 'input':'1', 'name':'Leisure volts'} sv = {'dev':'bbb', 'input':'0', 'name':'Starter volts'} la = {'dev':'bbb', 'input':'2', 'name'

Re: IDLE editor suggestion.

2023-12-12 Thread MRAB via Python-list
On 2023-12-12 08:22, Steve GS via Python-list wrote: Maybe this already exists but I have never seen it in any editor that I have used. It would be nice to have a pull-down text box that lists all of the searches I have used during this session. It would make editing a lot easier if I could sele

Re: IDLE editor suggestion.

2023-12-12 Thread MRAB via Python-list
On 2023-12-13 01:28, Steve GS via Python-list wrote: Does anything from the Visual Studio family of software have a pull down menu that lists previous searches so that I don’t have to enter them every time? SGA Visual Studio search box has a dropdown list that's shown when you press the down

Re: >>> %matplotlib inline results in SyntaxError: invalid syntax

2023-12-25 Thread MRAB via Python-list
On 2023-12-25 19:53, Alan Gauld via Python-list wrote: On 25/12/2023 05:34, geetanajali homes via Python-list wrote: import numpy as np import pandas as pd import random import matplotlib.pyplot as plt %matplotlib inline I get an error on the last line. I am running this code in Idle Pytho

Re: Extract lines from file, add to new files

2024-01-11 Thread MRAB via Python-list
On 2024-01-11 18:08, Rich Shepard via Python-list wrote: It's been several years since I've needed to write a python script so I'm asking for advice to get me started with a brief script to separate names and email addresses in one file into two separate files: salutation.txt and emails.txt. An

Re: How to create a binary tree hierarchy given a list of elements as its leaves

2024-01-28 Thread MRAB via Python-list
On 2024-01-28 18:16, marc nicole via Python-list wrote: So I am trying to build a binary tree hierarchy given numerical elements serving for its leaves (last level of the tree to build). From the leaves I want to randomly create a name for the higher level of the hierarchy and assign it to the ch

Re: Error pd.set_option('display.width', 10000)

2024-02-03 Thread MRAB via Python-list
On 2024-02-03 23:02, gelukt gelukt via Python-list wrote: Dear, While running a code, I get the error below: What does this error mean? How can I fix this error? C:\Users\brech\Desktop\Crypto\venv\Scripts\python.exe "C:/Users/brech/Desktop/Crypto/Project/aaa Arbitrage.py" Traceback (most recen

Re: test-ignore

2024-02-15 Thread MRAB via Python-list
On 2024-02-16 00:29, Skip Montanaro via Python-list wrote: > Test post to see if my Newsgroup post program is working. Aim your test messages at alt.test, please. I agree that basic Usenet connectivity messages should go to alt.test. It's not clear from the original post, but if the poster's

Re: A question about import

2024-02-16 Thread MRAB via Python-list
On 2024-02-16 20:07, Gabor Urban via Python-list wrote: Hi guys, I need something about modules to be clarified. Suppose I have written a module eg: ModuleA which imports an other module, let us say the datetime. If I import ModuleA in a script, will be datetime imported automatically? Yes.

Re: Using __new__

2024-02-17 Thread MRAB via Python-list
On 2024-02-17 22:35, Jonathan Gossage via Python-list wrote: I am attempting to use the __new__ method in the following code: class SingletonExample(object): _instance = None def __new__(cls, **kwargs): if cls._instance is None: cls._instance = super().__new__(cl

Re: Problem resizing a window and button placement

2024-02-23 Thread MRAB via Python-list
On 2024-02-24 01:14, Steve GS via Python-list wrote: Python, Tkinter: How do I determine if a window has been resized? I want to locate buttons vertically along the right border and need to know the new width. The buttons are to move with the change of location of the right-side border. Bind an

Re: Problem resizing a window and button placement

2024-02-24 Thread MRAB via Python-list
On 2024-02-25 00:33, Steve GS via Python-list wrote: "Well, yes, in Python a variable created inside a function or method is local to that function unless you declare it global." Yes, I knew that. I tried to global it both before the function call and within it. Same for when I created the varia

Re: Problem resizing a window and button placement

2024-02-24 Thread MRAB via Python-list
On 2024-02-25 02:51, Steve GS wrote: import tkinter as tk #global Ww Neither global helps def on_configure(*args): # print(args) #global Ww Neither global helps Ww = root.winfo_width() print("WwInside = <" + str(Ww) + ">") root = tk.Tk() root.bind('', on_configure) print

Re: Problem resizing a window and button placement

2024-02-25 Thread MRAB via Python-list
On 2024-02-25 21:19, Steve GS via Python-list wrote: SOLUTION FOUND! The fix was to write the code that uses the width value and to place it into the function itself. Kluge? Maybe but it works. Mischief Managed. As for the most recent suggestion, it fails for me: Tra

Re: Can u help me?

2024-03-05 Thread MRAB via Python-list
On 2024-03-06 00:06, Chano Fucks via Python-list wrote: [image: image.png] This list removes all images. -- https://mail.python.org/mailman/listinfo/python-list

Re: Can u help me?

2024-03-05 Thread MRAB via Python-list
On 2024-03-06 00:24, Ethan Furman via Python-list wrote: On 3/5/24 16:06, Chano Fucks via Python-list wrote: [image: image.png] The image is of MS-Windows with the python installation window of "Repair Successful". Hopefully somebody better at explaining that problem can take it from here..

Re: Can u help me?

2024-03-05 Thread MRAB via Python-list
On 2024-03-06 01:44, Ethan Furman via Python-list wrote: On 3/5/24 16:49, MRAB via Python-list wrote: > On 2024-03-06 00:24, Ethan Furman via Python-list wrote: >> On 3/5/24 16:06, Chano Fucks via Python-list wrote: >> >>> [image: image.png] >> >>

Re: If a dictionary key has a Python list as its value!

2024-03-07 Thread MRAB via Python-list
On 2024-03-07 14:11, Varuna Seneviratna via Python-list wrote: If a dictionary key has a Python list as its value, you can read the values one by one in the list using a for-loop like in the following. d = {k: [1,2,3]} for v in d[k]: print(v) No tutorial describes this, why? What is t

Re: the name ``wheel''

2024-03-21 Thread MRAB via Python-list
On 2024-03-21 11:36, Johanne Fairchild via Python-list wrote: Why is a whl-package called a ``wheel''? Is it just a pronunciation for the extension WHL or is it really a name? Also, it seems that when I install Python on Windows, it doesn't come with pip ready to run. I had to say python -

Re: xkcd.com/353 ( Flying with Python )

2024-03-30 Thread MRAB via Python-list
On 2024-03-30 11:25, Skip Montanaro via Python-list wrote: > https://xkcd.com/1306/ > what does SIGIL mean? I think its' a Perl term, referring to the $/@/# symbols in front of identifiers. I had a vague recollection of hearing it elsewhere (*Game of Thrones,* on

Re: Can you help me with this memoization simple example?

2024-03-30 Thread MRAB via Python-list
On 2024-03-31 00:09, marc nicole via Python-list wrote: I am creating a memoization example with a function that adds up / averages the elements of an array and compares it with the cached ones to retrieve them in case they are already stored. In addition, I want to store only if the result of t

Re: Can you help me with this memoization simple example?

2024-03-31 Thread MRAB via Python-list
ey not in cache: cache[key] = f(args[0], args[1]) return cache[key] return g Anything else is good in my code ? Thanks Le dim. 31 mars 2024 à 01:44, MRAB via Python-list a écrit : On 2024-03-31 00:09, marc nicole via Python-list wrote: > I am creating a memoization examp

Re: Running issues

2024-04-05 Thread MRAB via Python-list
On 2024-04-05 22:32, shannon makasale via Python-list wrote: Hi there, My name is Shannon. I installed Python 3.12 on my laptop a couple months ago, but realised my school requires me to use 3.11.1. I uninstalled 3.12 and installed 3.11.1. Unfortunately, I am unable to run python now. It keeps

Re: Version of NymPy

2024-05-15 Thread MRAB via Python-list
On 2024-05-15 19:42, Popov, Dmitry Yu via Python-list wrote: What would be the easiest way to learn which version of NumPy I have with my Anaconda distribution? Import numpy and print its '__version__' attribute. -- https://mail.python.org/mailman/listinfo/python-list

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread MRAB via Python-list
On 2024-05-19 19:13, Gilmeh Serda via Python-list wrote: On Sun, 19 May 2024 08:32:46 +0100, Alan Gauld wrote: I've honestly never experienced this "nightmare". I install stuff and it just works. Hear! Hear! Me too! And all that. I'm on Manjaro, which is a tad finicky about other people touc

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread MRAB via Python-list
On 2024-05-29 05:33, Kevin M. Wilson via Python-list wrote: The following is my effort to understand how to process a string, letter, by letter: def myfunc(name):        index = 0    howmax = len(name)    # while (index <= howmax):    while (index < howmax):        if (index % 2 == 0):         

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread MRAB via Python-list
On 2024-05-29 15:32, Thomas Passin via Python-list wrote: On 5/29/2024 8:55 AM, Kevin M. Wilson wrote: Please recall, I said the format for the email failed to retain the proper indents. I'll attach a picture of the code! Purpose; to uppercase every other letter in a string. Thanks all, KMW

Re: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-09 Thread MRAB via Python-list
On 2024-06-09 22:20, HenHanna via Python-list wrote: Chunk, ChunkC -- nice simple way(s) to write these in Python? (Chunk '(a a ba a a b b)) ==> ((a a) (b) (a a a) (b b)) (Chunk '(a a a a b c c a a d e e e e)) ==> ((a a a a) (b) (c c) (a a) (d) (e e e e)) (

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread MRAB via Python-list
On 2024-06-12 17:31, AVI GROSS via Python-list wrote: I am sure there is inertia to move from an older product and some people need a reason like this where the old becomes untenable. It seems Microsoft is having a problem where something lik 2/3 of Windows users have not upgraded from Windows 1

Re: win32clipboard writing to clipboard on Windows 11

2024-06-17 Thread MRAB via Python-list
On 2024-06-17 20:27, Rob Cliffe via Python-list wrote: Recently I acquired a new laptop running WIndows 11; my previous one uses WIndows 10.  I encountered a strange problem: I am using the win32clipboard backage (part of pywin32), and when I use SetClipboardData() to write text which consists **

Re: Timezone in HH:MM Format

2024-06-18 Thread MRAB via Python-list
On 2024-06-19 00:32, Ivan "Rambius" Ivanov via Python-list wrote: Hello, How can I convert a date, usually datetime.now(), into a format where the timezone is in hours:minutes format. I was able to get that format in shell: $ date +%Y-%m-%dT%H:%M:%S%:z 2024-06-18T19:24:09-04:00 The closest I g

Re: Decoding bytes to text strings in Python 2

2024-06-23 Thread MRAB via Python-list
On 2024-06-24 00:30, Chris Angelico via Python-list wrote: On Mon, 24 Jun 2024 at 08:20, Rayner Lucas via Python-list wrote: In article , ros...@gmail.com says... > > If you switch to a Linux system, it should work correctly, and you'll > be able to migrate the rest of the way onto Python 3. O

Re: Best (simplest) way to share data between processes

2024-07-07 Thread MRAB via Python-list
On 2024-07-07 23:27, Barry via Python-list wrote: On 7 Jul 2024, at 22:13, Chris Green via Python-list wrote: a simple file lock can then be used to prevent simultaneous access (well, simultaneous access when the writing process is writing). There is a simple pattern to make this robust.

Re: Issue with pip Installation on My Laptop

2024-07-27 Thread MRAB via Python-list
On 2024-07-27 21:58, Mats Wichmann via Python-list wrote: On 7/26/24 16:28, Thomas Passin via Python-list wrote: On 7/26/2024 7:25 AM, Lizna Shah via Python-list wrote: OSError: [WinError 225] Operation did not complete successfully because the file contains a virus or potentially unwanted sof

Re: new here

2024-08-20 Thread MRAB via Python-list
On 2024-08-20 23:26, Daniel via Python-list wrote: Hi folks - New here. I've perused some posts and haven't seen a posting FAQ for this NG. I'm learning python right now to realize some hobby goals I have regarding some smolnet services. What are the NG standards on pasting code in messages? Do

Re: Is there a better way? [combining f-string, thousands separator, right align]

2024-08-25 Thread MRAB via Python-list
On 2024-08-25 16:12, Gilmeh Serda via Python-list wrote: Subject explains it, or ask. This is a bloody mess: s = "123456789" # arrives as str f"{f'{int(s):,}': >20}" ' 123,456,789' You don't need to format twice; you can combine them: >>> s = "123456789" >>> f'{int(s): >20,}' '

Re: new here

2024-08-25 Thread MRAB via Python-list
On 2024-08-26 02:29, AVI GROSS via Python-list wrote: If everyone will pardon my curiosity, who and what purposes are these smaller environments for and do many people use them? I mean the price of a typical minimal laptop is not a big deal today. So are these for some sort of embedded uses? I

Re: Formatting a str as a number - Okay, one more related thing...

2024-08-31 Thread MRAB via Python-list
On 2024-08-31 06:31, Gilmeh Serda via Python-list wrote: On Fri, 30 Aug 2024 05:22:17 GMT, Gilmeh Serda wrote: f"{int(number):>20,}" I can find "," (comma) and I can find "_" (underscore) but how about " " (space)? Or any other character, for that matter? Any ideas? Of course I can do f"{1

Re: Correct syntax for pathological re.search()

2024-10-08 Thread MRAB via Python-list
On 2024-10-08 21:59, Alan Bawden via Python-list wrote: Karsten Hilbert writes: Python 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> tex = '\sout{' >>> tex

Re: Correct syntax for pathological re.search()

2024-10-11 Thread MRAB via Python-list
On 2024-10-11 22:13, AVI GROSS via Python-list wrote: Is there some utility function out there that can be called to show what the regular expression you typed in will look like by the time it is ready to be used? Obviously, life is not that simple as it can go through multiple layers with each

Re: Correct syntax for pathological re.search()

2024-10-08 Thread MRAB via Python-list
On 2024-10-08 19:30, Karsten Hilbert via Python-list wrote: Am Mon, Oct 07, 2024 at 08:35:32AM -0500 schrieb Michael F. Stemper via Python-list: I'm trying to discard lines that include the string "\sout{" (which is TeX, for those who are curious. I have tried: if not re.search("\sout{", lin

Re: Correct syntax for pathological re.search()

2024-10-08 Thread MRAB via Python-list
On 2024-10-07 14:35, Michael F. Stemper via Python-list wrote: I'm trying to discard lines that include the string "\sout{" (which is TeX, for those who are curious. I have tried: if not re.search("\sout{", line): if not re.search("\sout\{", line): if not re.search("\\sout{", line):

Re: shutil.rmtree() fails when used in Fedora (rpm) "mock" environment

2024-10-24 Thread MRAB via Python-list
On 2024-10-24 20:21, Left Right wrote: > > > The stack is created on line 760 with os.lstat and entries are appended > > > on lines 677 (os.rmdir), 679 (os.close) and 689 (os.lstat). > > > > > > 'func' is popped off the stack on line 651 and check in the following lines. > > > > > > I can't see

Re: shutil.rmtree() fails when used in Fedora (rpm) "mock" environment

2024-10-24 Thread MRAB via Python-list
On 2024-10-24 17:30, Left Right wrote: > The stack is created on line 760 with os.lstat and entries are appended > on lines 677 (os.rmdir), 679 (os.close) and 689 (os.lstat). > > 'func' is popped off the stack on line 651 and check in the following lines. > > I can't see anywhere else where somet

Re: shutil.rmtree() fails when used in Fedora (rpm) "mock" environment

2024-10-24 Thread MRAB via Python-list
On 2024-10-24 16:17, Left Right via Python-list wrote: From reading the code where the exception is coming from, this is how I interpret the intention of the author: they build a list (not sure why they used list, when there's a stack datastructure in Python) which they use as a stack, where the

Re: Using 'with open(...) as ...' together with configparser.ConfigParser.read

2024-10-29 Thread MRAB via Python-list
On 2024-10-29 13:56, Loris Bennett via Python-list wrote: Hi, With Python 3.9.18, if I do try: with open(args.config_file, 'r') as config_file: config = configparser.ConfigParser() config.read(config_file) print(config.sections()) i.e try to

Re: shutil.rmtree() fails when used in Fedora (rpm) "mock" environment

2024-10-25 Thread MRAB via Python-list
On 2024-10-24 08:33, Christian Buhtz via Python-list wrote: Hello, I am upstream maintainer of "Back In Time" [1] investigating an issue a distro maintainer from Fedora reported [2] to me. On one hand Fedora seems to use a tool called "mock" to build packages in a chroot environment. On the othe

Re: How to check whether audio bytes contain empty noise or actual voice/signal?

2024-10-26 Thread MRAB via Python-list
On 2024-10-25 17:25, marc nicole via Python-list wrote: Hello Python fellows, I hope this question is not very far from the main topic of this list, but I have a hard time finding a way to check whether audio data samples are containing empty noise or actual significant voice/noise. I am using

Re: Using 'with open(...) as ...' together with configparser.ConfigParser.read

2024-10-31 Thread MRAB via Python-list
On 2024-10-31 06:47, Loris Bennett via Python-list wrote: Jon Ribbens writes: On 2024-10-30, Loris Bennett wrote: Jon Ribbens writes: On 2024-10-30, Loris Bennett wrote: Jon Ribbens writes: As per the docs you link to, the read() method only takes filename(s) as arguments, if you have

Re: Old matplotlib animation now fails

2024-10-15 Thread MRAB via Python-list
On 2024-10-15 21:16, Martin Schöön via Python-list wrote: Some years ago I created a Python program that reads GPS data and creates an animation stored in an mp4 file. Not very elegant but it worked. Not very original as it was based on the example found here: https://shorturl.at/dTCZZ Last tim

Re: subprocess.Popen does not launch audacity

2025-01-10 Thread MRAB via Python-list
On 2025-01-10 19:15, Tim Johnson via Python-list wrote: Using Python 3.12.3 on Ubuntu 24.04 I've converted a legacy python2 script to python3. All went well. However, a glitch from python2 remains. The script uses dmenu to create menus to pick applications. Applications are then invoked from py