Re: Help with Streaming and Chunk Processing for Large JSON Data (60 GB) from Kenna API

2024-10-01 Thread Greg Ewing via Python-list
t has nothing to do with the protocol. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Best Practice Virtual Environment

2024-10-05 Thread Ulrich Goebel via Python-list
Hi, I learned to use virtual environments where ever possible, and I learned to pip install the required packages there. That works quite nice at home. Now I come to deploy a Python script on a debian linux server, making it usable for a couple of users there. Debian (or even Python3 itself

Re: Old matplotlib animation now fails

2024-10-16 Thread Martin Schöön via Python-list
Den 2024-10-15 skrev MRAB : > 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 >> It is the second to last line that throws an error: >> >> l.set_data(x0, y0) >> >> The error m

Re: Old matplotlib animation now fails

2024-10-16 Thread Martin Schöön via Python-list
Den 2024-10-15 skrev Stefan Ram : > Martin =?UTF-8?Q?Sch=C3=B6=C3=B6n?= wrote or quoted: >>l.set_data(x0, y0) > > Well, I got to say, it's pretty rad that you're rocking Python! > That language is the bee's knees, for real. > > As for your que

Re: Common objects for CLI commands with Typer

2024-10-16 Thread Roland Müller via Python-list
On 9/23/24 22:51, Dan Sommers via Python-list wrote: On 2024-09-23 at 19:00:10 +0100, Barry Scott wrote: On 21 Sep 2024, at 11:40, Dan Sommers via Python-list wrote: But once your code gets big the disciple of using classes helps maintenance. Code with lots of globals is problematic

Re: Old matplotlib animation now fails

2024-10-16 Thread Martin Schöön via Python-list
Den 2024-10-16 skrev Stefan Ram : > Martin =?UTF-8?Q?Sch=C3=B6=C3=B6n?= wrote or quoted: >>Me rocking Python? > >|to rock >|1. To use. To make do with, usually to great effect. >|"You don't need to make up the guest bed; we can rock the couch." > Urban Di

Re: Old matplotlib animation now fails

2024-10-16 Thread Chris Townley via Python-list
On 16/10/2024 22:47, rbowman wrote: On 16 Oct 2024 08:20:10 GMT, Martin Schöön wrote: Den 2024-10-15 skrev Stefan Ram : Martin =?UTF-8?Q?Sch=C3=B6=C3=B6n?= wrote or quoted: l.set_data(x0, y0) Well, I got to say, it's pretty rad that you're rocking Python! That language is

Announcement: distlib 0.3.9 released on PyPI

2024-10-10 Thread Vinay Sajip via Python-list
]. Regards, Vinay Sajip [1] https://pypi.org/project/distlib/0.3.9/ [2] https://distlib.readthedocs.io/en/latest/overview.html#change-log-for-distlib [3] https://github.com/pypa/distlib/issues/new/choose -- https://mail.python.org/mailman/listinfo/python-list

Re: Beazley's Problem

2024-10-06 Thread Antoon Pardon via Python-list
Op 23/09/2024 om 09:44 schreef Annada Behera via Python-list: The "next-level math trick" Newton-Raphson has nothing to do with functional programming. I have written solvers in purely iterative style. What is your point. Any problem solved in a functional style can also be solved

RE: Help with Streaming and Chunk Processing for Large JSON Data (60 GB) from Kenna API

2024-10-01 Thread AVI GROSS via Python-list
generators to give you as many primes as you want, and no more. So, if you can store arbitrary python code as part of your JSON, you can send quite a bit of somewhat compressed data. The real problem is how the JSON is set up. If you take umpteen data structures and wrap them all in something like

Re: Help with Streaming and Chunk Processing for Large JSON Data (60 GB) from Kenna API

2024-10-01 Thread Dan Sommers via Python-list
r overflowing. And yet somehow, the universe never collapsed. If you believe that some implementation of fsync fails to meet a specification, or fails to work correctly on files containign JSON, then file a bug report. -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with Streaming and Chunk Processing for Large JSON Data (60 GB) from Kenna API

2024-10-01 Thread Greg Ewing via Python-list
ad of collecting the whole list first. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] How to stop a specific thread in Python 2.7?

2024-10-03 Thread Cameron Simpson via Python-list
reexisting Event may be supplied. Return a 2-tuple of `(T,E)`. ''' if E is None: E = Event() T = Thread(target=target, args=[E, *a], kwargs=kw) return T, E Something along those lines. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list

How to check whether lip movement is significant using face landmarks in dlib?

2024-10-05 Thread marc nicole via Python-list
an aspect ratio for the lips to conclude they are moving significantly? Is the mentioned function able to tell whether the lips are significantly moving while the mouth is closed? -- https://mail.python.org/mailman/listinfo/python-list

Re: Best Practice Virtual Environment

2024-10-05 Thread Cameron Simpson via Python-list
Just make a shared virtualenv, eg in /usr/local or /opt somewhere. Have the script commence with: #!/path/to/the/shred/venv/bin/python and make it readable and executable. Problem solved. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list

Re: Python crash together with threads

2024-10-03 Thread Left Right via Python-list
> whereas I am quite sure that program flows do not overlap. You can never be sure of this in Python. Virtually all objects in Python are allocated on heap, so instantiating integers, doing simple arithmetic etc. -- all of this requires synchronization because it will allocate memory for a sha

Capturing screenshots and recording audio in an ongoing basis, and submitting data to a RESTFul API

2024-10-22 Thread Jacob Kruger via Python-list
nce is futile!...Acceptance is versatile..." -- https://mail.python.org/mailman/listinfo/python-list

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

2024-10-25 Thread Christian Buhtz via Python-list
thub.com/bit-team/backintime/issues/1911#issuecomment-2436851901> -- https://mail.python.org/mailman/listinfo/python-list

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

2024-10-25 Thread Christian Buhtz via Python-list
the issue might exist because of a combination of 3 factors: shutil.rmtree(), PyFakeFS in a chroot/mock build environment. [1] -- <https://github.com/bit-team/backintime/blob/c1d042ab67b9e117ac53e944518a0f4292fa075b/common/test/test_uniquenessset.py#L45> -- https://mail.python.org/mailman/listinfo/python-list

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

2024-10-25 Thread Christian Buhtz via Python-list
Am 25.10.2024 09:06 schrieb Christian Buhtz via Python-list: On a "regular" system all tests are running. To clarify: "regular" does not exclude PyFakeFS. It means on my own local development machine and on the TravsCI machines (Ubuntu 22 with Python 3.9 up to 3.13) a

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

2024-10-24 Thread Christian Buhtz via Python-list
os.close(dirfd) return if func is os.rmdir: os.rmdir(name, dir_fd=dirfd) return # Note: To guard against symlink races, we use the standard # lstat()/open()/fstat() trick. assert func is os.lstat E AssertionError /usr/lib64/python3.13/shutil.py:663: AssertionError -- https://mail.python.org/mailman/listinfo/python-list

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

2024-10-24 Thread Left Right via Python-list
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 elements of the stack are 4-tuples, the important

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

2024-10-24 Thread Dan Sommers via Python-list
On 2024-10-24 at 20:54:53 +0100, MRAB via Python-list wrote: > 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) a

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

2024-10-24 Thread Left Right via Python-list
ng the interpreter to import the same module multiple times, but if that was possible (which in principle it is), then it would explain the behavior. -- https://mail.python.org/mailman/listinfo/python-list

Re: Chardet oddity

2024-10-24 Thread Mark Bourne via Python-list
assigned the open file handle to `contents`, but passed `content` (with no "s") to `chardet.detect` - so the result would depend on whatever was previously assigned to `content`. {'encoding': 'Windows-1252', 'confidence': 0.7282676610947401, 'langua

Re: Chardet oddity

2024-10-24 Thread Roland Mueller via Python-list
ke 23. lokak. 2024 klo 20.11 Albert-Jan Roskam via Python-list ( [email protected]) kirjoitti: >Today I used chardet.detect in the repl and it returned windows-1252 >(incorrect, because it later resulted in a UnicodeDecodeError). When I > ran >chardet as a script

Re: learning Python

2024-10-29 Thread Mats Wichmann via Python-list
On 10/27/24 16:51, o1bigtenor via Python-list wrote: Greetings There are mountains of books out there. Any suggestions for documents for a just learning how to program and starting with Python (3)? Preference to a tool where I would be learning by doing - - - that works well for me. TIA

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

2024-10-29 Thread Jon Ribbens via Python-list
On 2024-10-29, Loris Bennett 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(c

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

2024-10-29 Thread Loris Bennett via Python-list
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 read the configuration with the variable defined

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Cameron Simpson via Python-list
On 01Nov2024 08:11, Loris Bennett wrote: Cameron Simpson writes: If you're using the Python email module to parse (or construct) the message as a `Message` object I'd expect that to happen automatically. I am using email.message.EmailMessage Noted. That seems like the correct a

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Cameron Simpson via Python-list
dy Unicode text (i.e. a regular Python string with the original text, unencoded). And to print that. -- https://mail.python.org/mailman/listinfo/python-list

Re: Correct module for site customization of path

2024-11-01 Thread Tim Johnson via Python-list
On 11/1/24 08:32, [email protected] wrote: ... After the recent upgrades I had to install youtube_dl with pipx for the new python version. When I ran the script which imported youtube_dl, I got an import error as it appears the path to the module was not in sys.path I see at several

Re: Printing UTF-8 mail to terminal

2024-11-04 Thread Loris Bennett via Python-list
still have access to `body` ? That would be the original > message text? Otherwise maybe: > > print(mail.get_content()) > > The objective is to obtain the message body Unicode text (i.e. a > regular Python string with the original text, unencoded). And to print >

TkInter Scrolled Listbox class?

2024-11-04 Thread Ulrich Goebel via Python-list
problem which I can't handle is to handle the Frame which seems to be needed to place the Scrollbar somewhere. Best regards Ulrich -- Ulrich Goebel -- https://mail.python.org/mailman/listinfo/python-list

Re: Printing UTF-8 mail to terminal

2024-11-04 Thread Loris Bennett via Python-list
Inada Naoki writes: > 2024年11月2日(土) 0:36 Loris Bennett via Python-list : > >> Left Right writes: >> >> > There's quite a lot of misuse of terminology around terminal / console >> > / shell. Please, correct me if I'm wrong, but it looks like you ar

Re: TkInter Scrolled Listbox class?

2024-11-04 Thread Alan Gauld via Python-list
On 04/11/2024 15:32, Ulrich Goebel via Python-list wrote: > I would like to build a class ScrolledListbox, I assume like the one that used to be available via the Tix module? It's a great shame that Tix is gone, it had a lot of these useful widgets, but they were all wrappers around

Re: TkInter Scrolled Listbox class?

2024-11-04 Thread Cameron Simpson via Python-list
def config(self, *a, **kw): return self.Listbox.config(*a, **kw) and so forth for the various listbox methods you want to proxy to the listbox itself. You could pass scroll specific methods to the scrollbar as well. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/p

Re: Printing UTF-8 mail to terminal

2024-11-04 Thread Loris Bennett via Python-list
n is: What conversion is necessary in order to print the >>>>EmailMessage object to the terminal, such that the quoted-printable >>>>parts are turned (back) into UTF-8? >>> >>> Do you still have access to `body` ? That would be the original >>>

Re: TkInter Scrolled Listbox class?

2024-11-05 Thread Vishal Chandratreya via Python-list
could populate your list box and then put it inside that frame. I’ve not tested this scenario, so I’d appreciate feedback! Thanks.  On 4 Nov 2024, at 21:28, Ulrich Goebel via Python-list wrote: Hi, I would like to build a class ScrolledListbox, which can be packed

Re: Printing UTF-8 mail to terminal

2024-11-04 Thread Loris Bennett via Python-list
uch that the quoted-printable >>>parts are turned (back) into UTF-8? >> >> Do you still have access to `body` ? That would be the original >> message text? Otherwise maybe: >> >> print(mail.get

Two python issues

2024-11-05 Thread Raymond Boute via Python-list
L.S., Python seem to suffer from a few poor design decisions regarding strings and lists that affect the elegance of the language. (a) An error-prone "feature" is returning -1 if a substring is not found by "find", since -1 currently refers to the last item. An example:

Re: Printing UTF-8 mail to terminal

2024-11-05 Thread Cameron Simpson via Python-list
rs, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list

Re: Two python issues

2024-11-05 Thread Jason Friedman via Python-list
ld be > len(s) - 1 (no laziness!). > I'm not sure if this answers your objection but the note in the documentation (https://docs.python.org/3/library/stdtypes.html#str.find) says: The find() method should be used only if you need to know the position of sub. I think the use case above is a little bit different. -- https://mail.python.org/mailman/listinfo/python-list

Re: Two python issues

2024-11-05 Thread Cameron Simpson via Python-list
On 05Nov2024 15:48, Raymond Boute wrote: Python seem to suffer from a few poor design decisions regarding strings and lists that affect the elegance of the language. (a) An error-prone "feature" is returning -1 if a substring is not found by "find", since -1 currently ref

Specifying local dependency with Poetry

2024-11-05 Thread Loris Bennett via Python-list
ld specify this dependency in pyproj.toml via [tool.poetry.dependencies] python = "^3.6" first-package = "^1.6.0" However, if I do that and then attempt to install the second package, I get the error Could not find a version that satisfies the requirement first-package<2.0

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

2024-10-30 Thread Jon Ribbens via Python-list
e(name)? The ConfigParser module provides read(), read_file(), read_string(), and read_dict() methods. I think they were just trying to be comprehensive. It's a bit non-Pythonic really. -- https://mail.python.org/mailman/listinfo/python-list

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

2024-10-30 Thread Loris Bennett via Python-list
Jon Ribbens writes: > On 2024-10-29, Loris Bennett wrote: >> Hi, >> >> With Python 3.9.18, if I do >> >> try: >> with open(args.config_file, 'r') as config_file: >> config = configparser.ConfigParser() >&

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

2024-10-30 Thread Jon Ribbens via Python-list
or stream? Well, sure - any time it's not being read from a file. A bit ironic that the method to use in that situation is "read_file", of course. In my view the read() and read_file() methods have their names the wrong way round. But bear in mind this code is 27 years old, and the read() function came first. -- https://mail.python.org/mailman/listinfo/python-list

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

2024-10-30 Thread Loris Bennett via Python-list
a common situation might I be obliged to use 'read_file'? I.e. is there some common case where the file name is not available, only a corresponding file-like object or stream? -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

Re: Printing UTF-8 mail to terminal

2024-10-31 Thread Left Right via Python-list
ncoding to UTF-8 permanently: https://superuser.com/questions/269818/change-default-code-page-of-windows-console-to-utf-8 , which, I believe, will solve your problem with how the text is displayed. On Thu, Oct 31, 2024 at 5:19 PM Loris Bennett via Python-list wrote: > > Hi, > > I have a command

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Loris Bennett via Python-list
the salutation > text provided by the "salutation server" and the mail body from a file > are encoded. This seems to be different. > >> Your terminal probably accepts UTF-8 - I imagine other German text >> renders corectly? > > Yes, it does. > >> You n

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Loris Bennett via Python-list
splayed. I'm not using MS Windows. I am using a Gnome terminal on Debian 12 locally and connecting via SSH to a AlmaLinux 8 server, where I start a tmux session. > On Thu, Oct 31, 2024 at 5:19 PM Loris Bennett via Python-list > wrote: >> >> Hi, >> >> I have a command-l

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Loris Bennett via Python-list
rminal probably accepts UTF-8 - I imagine other German text > renders corectly? Yes, it does. > You need to get the text and undo the quoted-printable encoding. > > If you're using the Python email module to parse (or construct) the > message as a `Message` object I'd expect

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Dieter Maurer via Python-list
ded with `quoted-printable`. Maybe, you do not need to pass `cte`? -- https://mail.python.org/mailman/listinfo/python-list

Re: Correct module for site customization of path

2024-11-01 Thread Dieter Maurer via Python-list
> ... >After the recent upgrades I had to install youtube_dl with pipx for the >new python version. >When I ran the script which imported youtube_dl, I got an import error >as it appears the path to the module >was not in sys.path I see at several options: * install `

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Cameron Simpson via Python-list
On 31Oct2024 21:53, [email protected] wrote: On 31/10/2024 20:50, Cameron Simpson via Python-list wrote: If you're just dealing with this directly, use the `quopri` stdlib module: https://docs.python.org/3/library/quopri.html One of the things I love about this list are these l

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Left Right via Python-list
nyways, OP said they were using an actual terminal (emulator) on Ubuntu, and it looks like their problem is more with extracting information from the email message rather than with the terminal capabilities. Also, looks like there was an answer already wrt. message.get_body() -- https://mail.python.org/mailman/listinfo/python-list

Re: Printing UTF-8 mail to terminal

2024-11-02 Thread Jon Ribbens via Python-list
On 2024-11-01, Eli the Bearded <*@eli.users.panix.com> wrote: > In comp.lang.python, Gilmeh Serda wrote: >> Python 3.12.6 (main, Sep 8 2024, 13:18:56) [GCC 14.2.1 20240805] on linux >> Type "help", "copyright", "credits" or "license&quo

Re: Printing UTF-8 mail to terminal

2024-11-02 Thread Inada Naoki via Python-list
Try PYTHONUTF8=1 envver. 2024年11月2日(土) 0:36 Loris Bennett via Python-list : > Left Right writes: > > > There's quite a lot of misuse of terminology around terminal / console > > / shell. Please, correct me if I'm wrong, but it looks like you are > > print

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

2024-10-28 Thread Lars Liedtke via Python-list
homas Passin via Python-list: On 10/25/2024 12:25 PM, 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 signi

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

2024-10-25 Thread marc nicole via Python-list
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 PyAudio to collect the sound through my PC mic as follows

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-11 Thread Cameron Simpson via Python-list
f you omit your "try ... except FileNotFoundError` (or start the `except` clause with a `raise`), you will learn where in the code the exception has been raised and likely as well what was not found (Python is quite good with such error details). Actually, file-not-found is pretty well de

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-11 Thread Chris Angelico via Python-list
On Tue, 12 Nov 2024 at 01:59, Loris Bennett via Python-list wrote: > 2. In terms of generating a helpful error message, how should one >distinguish between the config file not existing and the log file not >existing? By looking at the exception's attributes rather than ass

Re: Seeking Assistance with Python's IDLE for Blind Users

2024-11-11 Thread Loris Bennett via Python-list
Dear Jeff, writes: > Dear Python Users Group, > > > > I am currently learning Python. I am blind and use the JAWS screen reader to > assist me. I am trying to use Python's IDLE editor but find it quite > challenging. When I move my cursor to a line of code, it reads

Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)

2024-11-08 Thread Thomas Passin via Python-list
On 11/8/2024 2:09 PM, dn via Python-list wrote: On 8/11/24 14:40, Mild Shock via Python-list wrote: Well you can use your Browser, since JavaScript understand post and pre increment: Question: are we talking Python or JavaScript? So we have x ++ equals in Python: Trying to find a word

SOLVED: Tkinter button-motion event behaves differently under Windows and Linux

2024-11-11 Thread John O'Hagan via Python-list
nted anywhere and I'm interested to know if anyone can cast any light on it. Thanks -- https://mail.python.org/mailman/listinfo/python-list

FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-11 Thread Loris Bennett via Python-list
og file not existing? Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-11 Thread Left Right via Python-list
Poor error reporting is a very common problem in programming. Python is not anything special in this case. Of course, it would've been better if the error reported what file wasn't found. But, usually these problems are stacking, like in your code. Unfortunately, it's yo

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-11 Thread Dieter Maurer via Python-list
u omit your "try ... except FileNotFoundError` (or start the `except` clause with a `raise`), you will learn where in the code the exception has been raised and likely as well what was not found (Python is quite good with such error details). > ... >My questions are: > >1. Should I b

Re: Seeking Assistance with Python's IDLE for Blind Users

2024-11-12 Thread Jacob Kruger via Python-list
er of NVDA, which is itself written in python, and not a jaws user, so you might do better to ask some of the other people in that context - general blind programmer's mailing list: https://www.freelists.org/list/program-l And, the pythonvis blind python programmer's maili

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

2024-10-26 Thread Christian Buhtz via Python-list
As you can see in the linked issue it seems it was an incompatibility between the version of Python and PyFakeFS. In the end it was a Fedora packaging bug because that pyfakefs version was not compatible with Python 3.13. Thanks in advance for helping out. -- https://mail.python.org/mailman

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

2024-10-24 Thread Left Right via Python-list
ead 1 assert func is os.lstat # thread 1 (failure!) The only question is: is it possible to modify os.lstat like that, and if so, how? Other alternatives include a malfunctioning "is" operator, malfunctioning module cache... all those are a lot less likely. -- https://mail.python.org/mailman/listinfo/python-list

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

2024-10-24 Thread Left Right via Python-list
nted that the reference to os.lstat *can* be modified in this way. But, before we keep guessing any further, it'd be best if OP could get us the info on what's stored in "func" and "os.lstat" at the time the assertion fails. -- https://mail.python.org/mailman/listinfo/python-list

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

2024-10-26 Thread Thomas Passin via Python-list
On 10/25/2024 12:25 PM, 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

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Rob Cliffe via Python-list
On 12/11/2024 08:52, Loris Bennett via Python-list wrote: Cameron Simpson writes: Generally you should put a try/except around the smallest possible piece of code. That is excellent advice. Best wishes Rob Cliffe So: config = configparser.ConfigParser() try

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Loris Bennett via Python-list
Chris Angelico writes: > On Tue, 12 Nov 2024 at 01:59, Loris Bennett via Python-list > wrote: >> 2. In terms of generating a helpful error message, how should one >>distinguish between the config file not existing and the log file not >>existing? > >

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Karsten Hilbert via Python-list
Am Tue, Nov 12, 2024 at 09:52:31AM +0100 schrieb Loris Bennett via Python-list: > Regarding your example above, if 'missingfile.py' contains the following > > import configparser > > config = configparser.ConfigParser() > > try: > config.read('

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Chris Angelico via Python-list
On Wed, 13 Nov 2024 at 07:29, Mats Wichmann via Python-list wrote: > > On 11/12/24 12:10, Left Right via Python-list wrote: > > > Finally, if you want your logs to go to a file, and currently, your > > only option is stderr, your shell gives you a really, really simple &

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Greg Ewing via Python-list
eason it has to lose data. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-13 Thread Roel Schroeven via Python-list
Op 12/11/2024 om 20:10 schreef Left Right via Python-list: > I am not entirely convinced by NB2. I am, in fact, a sort of sysadmin > person and most of my programs write to a log file. The programs are > also moderately complex, so a single program might access a database, > q

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Mats Wichmann via Python-list
On 11/12/24 12:10, Left Right via Python-list wrote: Finally, if you want your logs to go to a file, and currently, your only option is stderr, your shell gives you a really, really simple way of redirecting stderr to a file. So, really, there aren't any excuses to do that. an awful l

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Loris Bennett via Python-list
le {args.config_file} not found. >>> Exiting.") >> >>Do not replace full error information (including a traceback) >>with your own reduced error message. >>If you omit your "try ... except FileNotFoundError` >>(or start the `except` clause with a

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Loris Bennett via Python-list
Chris Angelico writes: > On Tue, 12 Nov 2024 at 01:59, Loris Bennett via Python-list > wrote: >> 2. In terms of generating a helpful error message, how should one >>distinguish between the config file not existing and the log file not >>existing? > >

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Loris Bennett via Python-list
Left Right writes: > Poor error reporting is a very common problem in programming. Python > is not anything special in this case. Of course, it would've been > better if the error reported what file wasn't found. But, usually > these problems are stacking, like in you

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Left Right via Python-list
your logs to go to a file, and currently, your only option is stderr, your shell gives you a really, really simple way of redirecting stderr to a file. So, really, there aren't any excuses to do that. -- https://mail.python.org/mailman/listinfo/python-list

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-13 Thread Dieter Maurer via Python-list
l.python.org/mailman/listinfo/python-list

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

2024-10-31 Thread Jon Ribbens via Python-list
t, or an HTTP request, or from a database. It is good practice in general to provide a method that allows your class to read data as a stream, if that is appropriate for what you're doing, so that people aren't unnecessarily forced to load data fully into memory or write it to a file, as well as perhaps a convenience method thaat will read from a named file for people who are doing that. -- https://mail.python.org/mailman/listinfo/python-list

ANN: PyDDF Python Herbst Sprint 2024

2024-10-31 Thread eGenix Team via Python-list
/This announcement is in German since it targets a local user group//meeting in Düsseldorf, Germany/ Ankündigung Python Meeting Herbst Sprint 2024 <https://www.meetup.com/python-meeting-dusseldorf/events/303528848/> in Düsseldorf <http://www.duesseldorf.de/> Samstag, 09.11

Printing UTF-8 mail to terminal

2024-10-31 Thread Loris Bennett via Python-list
-- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

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

2024-10-31 Thread Karsten Hilbert via Python-list
Am Thu, Oct 31, 2024 at 07:47:17AM +0100 schrieb Loris Bennett via Python-list: > However I didn't make myself clear: I understand that there are > different functions, depending on whether I have a file name or a > stream. Nevertheless, I just can't think of a practical exam

Poetry: endpoints with endpoints

2024-10-31 Thread Loris Bennett via Python-list
dd such endpoint? If so, how? Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

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

2024-10-31 Thread Loris Bennett via Python-list
functions, depending on whether I have a file name or a stream. Nevertheless, I just can't think of a practical example where I might just have *only* a stream, especially one containing my configuration data. I was just interested to know if anyone can give an example. -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

Re: Printing UTF-8 mail to terminal

2024-10-31 Thread Cameron Simpson via Python-list
and undo the quoted-printable encoding. If you're using the Python email module to parse (or construct) the message as a `Message` object I'd expect that to happen automatically. If you're just dealing with this directly, use the `quopri` stdlib module: https://docs.pytho

Re: Printing UTF-8 mail to terminal

2024-10-31 Thread Alan Gauld via Python-list
On 31/10/2024 20:50, Cameron Simpson via Python-list wrote: > That looks to me like quoted-printable. This is an encoding for binary > transport of text to make it robust against not 8-buit clean ... > If you're just dealing with this directly, use the `quopri` stdlib &

Correct module for site customization of path

2024-10-31 Thread Tim Johnson via Python-list
FYI: I am retired programmer using a recent upgrade to ubuntu 24.04 and python 3.12 My needs are that of a hobbyist at this time. I am on a single user home desktop with root privileges available. After the recent upgrades I had to install youtube_dl with pipx for the new python version. When

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Dieter Maurer via Python-list
t;Error: configuration file {args.config_file} not found. >>> Exiting.") >> >>Do not replace full error information (including a traceback) >>with your own reduced error message. >>If you omit your "try ... except FileNotFoundError` >>(or start the `exce

Python 3.8 or later on Debian?

2024-09-18 Thread Ulrich Goebel via Python-list
Hi, Debian Linux seems to love Python 3.7 - that is shown by apt-get list, and it's installed on my Debian Server. But I need at least Python 3.8 Is there a repository which I can give to apt to get Python 3.8 or later? Or do I really have to install and compile these versions manually

Re: Python 3.8 or later on Debian?

2024-09-18 Thread Alexander Neilson via Python-list
Python 3.7 is part of Buster (Debian old old stable) If you moved to Debian bullseye you would get offered 3.9 (old stable) Currently the stable version (Bookworm) would give you 3.11 I am not aware of anyone maintaining a repo for old Debian versions to get newer Python versions. But I know in

Re: Common objects for CLI commands with Typer

2024-09-23 Thread Barry Scott via Python-list
> On 21 Sep 2024, at 11:40, Dan Sommers via Python-list > wrote: > > Despite the fact that "everything is an object" in Python, you don't > have to put data or functions inside classes or objects. I also know > nothing about Typer, but there's noth

Re: Common objects for CLI commands with Typer

2024-09-21 Thread Dan Sommers via Python-list
On 2024-09-21 at 06:38:05 +0100, Barry via Python-list wrote: > > On 20 Sep 2024, at 21:01, Loris Bennett via Python-list > > wrote: > > > > Hi, > > > > Apologies if the following description is to brief - I can expand if no > > one knows what I&#x

<    55   56   57   58   59   60   61   62   63   64   >