BeautifulSoup doesn't work with a threaded input queue?

2017-08-27 Thread Christopher Reimer via Python-list
.py (which puts it in the RLock factory function). When I switched back to using list between the Requestor and Parser, the Parser worked again. BeautifulSoup doesn't work with a threaded input queue? Thank you, Chris Reimer -- https://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup doesn't work with a threaded input queue?

2017-08-27 Thread Christopher Reimer via Python-list
BeautifulSoup may not be thread-safe. I've never had a problem with threads storing the output into a queue. Using a queue (random order) instead of a list (sequential order) to feed pages for the input is making it wonky. Chris R. -- https://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup doesn't work with a threaded input queue?

2017-08-27 Thread Christopher Reimer via Python-list
in at different times for the parser worker threads to get for processing. Similar situation with a list but I sort the list before giving it to the parser, so all the items are in sequential order and fed to the parser one at time. Chris R. -- https://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup doesn't work with a threaded input queue?

2017-08-27 Thread Christopher Reimer via Python-list
20 read_threads requesting and putting pages into the output queue that is the input_queue for the parser. My soup_threads can get items from the queue, but BeautifulSoup doesn't do anything after that. Chris R. -- https://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup doesn't work with a threaded input queue?

2017-08-27 Thread Christopher Reimer via Python-list
list, I'm using a for loop to input items into the parser. If I'm using a queue, I'm using worker threads to put or get items. The item is still the same whether in a list or a queue. Chris R. -- https://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup doesn't work with a threaded input queue?

2017-08-27 Thread Christopher Reimer via Python-list
ris R. -- https://mail.python.org/mailman/listinfo/python-list

Is there tested Python code for parsing N-Triples?

2017-08-31 Thread David Shi via Python-list
Is there tested Python code for parsing N-Triples? Looking forward to hearing from you. Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Exponential Smoothing program

2017-08-31 Thread Ode Idoko via Python-list
Putting Your Talent to Work" Click link below to view book. http://www.authorhouse.co.uk/Bookstore/BookDetail.aspx?BookId=SKU-000425821 ...let God alone be true and all men liars! -- https://mail.python.org/mailman/listinfo/python-list

rdflib, N-Triples and Pandas

2017-09-01 Thread David Shi via Python-list
How best to use rdflib to parse N-Triples files and turn them into Pandas tables? Looking forward to hearing from you. Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Select data in N-Triples

2017-09-01 Thread David Shi via Python-list
thing like "Baginton E04009817". Then, put the name and code into corresponding cells in 2 columns. Maybe, the solution is to find ways to select those lines having rdf-schema#label Is there a good example? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: Best Practice Virtual Environment

2024-10-08 Thread Left Right via Python-list
ere. Also, the big actors in the industry s.a. Microsoft and Amazon do the exact opposite of what I suggest. I have no problem acknowledging this and still maintaining that they are wrong and I'm right :) But, you don't have to trust me! -- https://mail.python.org/mailman/listinfo/python-list

Re: Correct syntax for pathological re.search()

2024-10-08 Thread Karsten Hilbert via Python-list
Am Tue, Oct 08, 2024 at 08:07:04PM +0100 schrieb MRAB via Python-list: > >unwanted_tex = '\sout{' > >if unwanted_tex not in line: do_something_with_libreoffice() > > > That should be: > > unwanted_tex = r'\sout{' Hm. Python 3.11.2 (mai

Re: Correct syntax for pathological re.search()

2024-10-08 Thread Alan Bawden via Python-list
ot;credits" or "license" for more information. >>> tex = '\sout{' :1: DeprecationWarning: invalid escape sequence '\s' >>> -- https://mail.python.org/mailman/listinfo/python-list

Re: Correct syntax for pathological re.search()

2024-10-08 Thread Jon Ribbens via Python-list
those things, and instead do: from pathlib import Path path = Path(r'C:\Windows\example') since in a Path the trailing '\' or '/' is unnecessary. Which leaves very few remaining uses for a raw-string with a trailing '\'... -- https://mail.python.org/mailman/listinfo/python-list

Re: Correct syntax for pathological re.search()

2024-10-08 Thread Karsten Hilbert via Python-list
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{", line): > if no

Signing off

2024-10-08 Thread AVI GROSS via Python-list
rests including many other programming languages and it is time I stopped using python when I have so much else to choose from. My best wishes to everyone here. Avi -- https://mail.python.org/mailman/listinfo/python-list

RE: Correct syntax for pathological re.search()

2024-10-12 Thread AVI GROSS via Python-list
. -Original Message- From: Python-list On Behalf Of Peter J. Holzer via Python-list Sent: Saturday, October 12, 2024 7:00 AM To: python-list@python.org Subject: Re: Correct syntax for pathological re.search() On 2024-10-11 17:13:07 -0400, AVI GROSS via Python-list wrote: > Is there some util

Re: Correct syntax for pathological re.search()

2024-10-12 Thread Thomas Passin via Python-list
On 10/11/2024 8:37 PM, MRAB via Python-list wrote: 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

Re: Correct syntax for pathological re.search()

2024-10-12 Thread Thomas Passin via Python-list
On 10/12/2024 6:59 AM, Peter J. Holzer via Python-list wrote: On 2024-10-11 17:13:07 -0400, 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? I assume

Re: Correct syntax for pathological re.search()

2024-10-09 Thread Karsten Hilbert via Python-list
Am Tue, Oct 08, 2024 at 04:59:48PM -0400 schrieb Alan Bawden via Python-list: > 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

[RELEASE] Python 3.13.0 (final) released

2024-10-07 Thread Thomas Wouters via Python-list
Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation <https://www.python.org/psf-landing/>. Choo-choo from the release train, Your release team, Thomas Wouters Ned Deily Steve Dower Łukasz Langa -- https://mail.python.org/mailman/listinfo/python-list

RE: Correct syntax for pathological re.search()

2024-10-11 Thread AVI GROSS via Python-list
cases, ... -Original Message- From: Python-list On Behalf Of Gilmeh Serda via Python-list Sent: Friday, October 11, 2024 10:44 AM To: python-list@python.org Subject: Re: Correct syntax for pathological re.search() On Mon, 7 Oct 2024 08:35:32 -0500, Michael F. Stemper wrote: > I'

Re: Best Practice Virtual Environment

2024-10-05 Thread Thomas Passin via Python-list
On 10/5/2024 4:27 PM, Ulrich Goebel via Python-list wrote: 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

Re: Best Practice Virtual Environment

2024-10-05 Thread Karsten Hilbert via Python-list
Am Sat, Oct 05, 2024 at 10:27:33PM +0200 schrieb Ulrich Goebel via Python-list: > Debian (or even Python3 itself) doesn't allow to pip install required > packages system wide, so I have to use virtual environments even there. But > is it right, that I have to do that for eve

Re: Best Practice Virtual Environment

2024-10-06 Thread Karsten Hilbert via Python-list
Am Sun, Oct 06, 2024 at 12:21:09AM +0200 schrieb Karsten Hilbert via Python-list: > Am Sat, Oct 05, 2024 at 10:27:33PM +0200 schrieb Ulrich Goebel via > Python-list: > > > Debian (or even Python3 itself) doesn't allow to pip install required > > packages system wide

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
n.org/mailman/listinfo/python-list

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
stion, here's my two cents off the cuff: > Could it be that the newer Matplotlib versions are jonesing > for something like "l.set_data( [ x0 ],[ y0 ])" in that spot? > Thanks, that was quick and adding square brackets fixed my code. Me rocking Python? /Martin -- https://mail.python.org/mailman/listinfo/python-list

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
early did not like this video.) /Martin -- https://mail.python.org/mailman/listinfo/python-list

Re: Old matplotlib animation now fails

2024-10-16 Thread Chris Townley via Python-list
. Me rocking Python? /Martin You have to understand Stefan tries to use American slang, not always entirely accurately. I think 'bee's knees' died out around 1931. Not sure about America, but the bee's knees is still in common use in the UK -- Chris -- https://mail.python.org/mailman/listinfo/python-list

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
am results. If I only want info on records about company X between July 1 and September 15 of a particular year and only if the amount paid remains zero or is less than the amount owed, ... -Original Message----- From: Python-list On Behalf Of Greg Ewing via Python-list Sent: Tuesday, October

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
red pool. The description of _PyThreadState_GET states that callers must hold GIL. Does your code do that? It's not possible to divine that from the stack trace, but you'd probably know that. On Wed, Oct 2, 2024 at 3:29 PM Guenther Sohler via Python-list wrote: > > My Software

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
e, multithreaded environments it could happen... To investigate this, I'd edit the file with the assertion and make it print the actual value found in os.lstat and func. My guess is that they are both somehow "lstat", but with different memory addresses. On Thu, Oct 24, 2024 at 4:06 

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
ge': ''} # Terminal $ python -m chardet FILENAME FILENAME: MacRoman with confidence 0.7167379080370483 Thanks! Albert-Jan -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

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 ( python-list@python.org) 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
object variable here? If so > how? > > Here > > https://docs.python.org/3.9/library/configparser.html > > there are examples which use the 'with open ... as' variable for writing > a configuration file, but not for reading one. As per the docs you link to, the read() method only takes filename(s) as arguments, if you have an already-open file you want to read then you should use the read_file() method instead. -- https://mail.python.org/mailman/listinfo/python-list

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

2024-10-29 Thread Loris Bennett via Python-list
config_file' is just Should I be able to use the '_io.TextIOWrapper' object variable here? If so how? Here https://docs.python.org/3.9/library/configparser.html there are examples which use the 'with open ... as' variable for writing a configuration file, but not for reading one. Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Cameron Simpson via Python-list
Can you should the code (or example code) which leads to the qp output? I suspect there's a straight forward way to get the decoded Unicode, but I'd need to see how what you've got was obtained. -- https://mail.python.org/mailman/listinfo/python-list

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
ze.py # Thanks seems to work for me cheers -- Tim thjmm...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Printing UTF-8 mail to terminal

2024-11-04 Thread Loris Bennett via Python-list
s the subject is fine, but it is unclear to me how to print the body. Or rather, I know how to print the body OK, but I don't know how to print the headers separately - there seems to be nothing like 'get_headers()'. I can use 'get('Subject) etc. and reconstruct the headers, but that seems a little clunky. Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

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
nd reconstruct the >> headers, but that seems a little clunky. > > Sorry, I am confusing the terminology here. The 'body' seems to be the > headers plus the 'content'. So I can print the *content* without the > headers OK, but I can't easily print all the headers separately. If > just print the body, i.e. headers plus content, the umlauts in the > content are not resolved. OK, so I can do: ## if args.verbose: for k in mail.keys(): print(f"{k}: {mail.get(k)}") print('') print(mail.get_content()) ## prints what I want and is not wildly clunky, but I am a little surprised that I can't get a string representation of the whole email in one go. Cheers, Loris -- Dr. Loris Bennett (Herr/Mr) FUB-IT, Freie Universität Berlin -- https://mail.python.org/mailman/listinfo/python-list

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
on't > know how to print the headers separately - there seems to be nothing > like 'get_headers()'. I can use 'get('Subject) etc. and reconstruct the > headers, but that seems a little clunky. Sorry, I am confusing the terminology here. The 'body' seems to be the headers plus the 'content'. So I can print the *content* without the headers OK, but I can't easily print all the headers separately. If just print the body, i.e. headers plus content, the umlauts in the content are not resolved. -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

Two python issues

2024-11-05 Thread Raymond Boute via Python-list
nt for slices, only lists with the same length as the slice should be acceptable, otherwise an error should be given.  Anything that re-indexes items not covered by the slice is against the essential idea of assignment. For changes that imply re-indexing (e.g., inserting a list longer than the slice), Python offers cleaner solutions. Comments are welcome. With best regards, Raymond -- https://mail.python.org/mailman/listinfo/python-list

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
error should be given. There are many many circumstances where we replace a subsequence with a different subsequence of different length. Outlawing such a thing would remove and extremely useful feature. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list

Specifying local dependency with Poetry

2024-11-05 Thread Loris Bennett via Python-list
.0,>=1.6.0 (from second-package==0.5.0) (from versions: ) No matching distribution found for first-package<2.0.0,>=1.6.0 (from second-package==0.5.0) How should I define the dependency? 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-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
n already-open file you want to read then > you should use the read_file() method instead. As you and others have pointed out, this is indeed covered in the docs, so mea culpa. However, whereas I can see why you might want to read the config from a dict or a string, what would be a use case in which I would want to read from an open file rather than just reading from a file(name)? 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-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
dy) and look at the log file in my terminal I see 2024-11-01 09:59:12,318 - DEBUG - mailer:create_body - body: Sehr geehrter Herr Dr. Bennett, Dies ist eine Übung. ... as expected. The non-UTF-8 text occurs when I do mail = EmailMessage() mail.set_content(body, cte="quoted-printable") ... if args.verbose: print(mail) which is presumably also correct. The question 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? Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

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
the subject and body are encoded in the same way. The problem just occurs with the unsent string representation printed to the terminal. Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

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
es where to look for modules. You can place `.pth` files where Python looks for modules to be imported -- https://mail.python.org/mailman/listinfo/python-list

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Cameron Simpson via Python-list
On 31Oct2024 21:53, alan.ga...@yahoo.co.uk 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
y just > write it for myself if I didn't quickly find it while working with > email.) Python went through a period of time where lots of things just got stuck in the standard library without any particula taxonomy. Hence ending up with base64, binascii, binhex, quopri, and uu all being separate top-level modules, only some of which got tidied up in Python 3. -- https://mail.python.org/mailman/listinfo/python-list

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
; to check whether data is filled with empty noise or that somebody has made noise/spoke? Thanks. -- 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 Cameron Simpson via Python-list
-- 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 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
net/ which has been around for 30 years, so that may be worth having a look at. Cheers, Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

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
config.fileConfig(args.config_file) > > My questions are: > > 1. Should I be surprised by this behaviour? > 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? > > Cheers, > > Loris > > -- > This signature is currently under constuction. > -- > https://mail.python.org/mailman/listinfo/python-list -- 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 Dieter Maurer via Python-list
error information provided by Python (and its library) rather than hiding it. -- https://mail.python.org/mailman/listinfo/python-list

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

2024-11-12 Thread Jacob Kruger via Python-list
quot;Resistance is futile!...Acceptance is versatile..." On 2024/11/11 00:28, Jeff via Python-list wrote: 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 chal

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

2024-10-26 Thread Christian Buhtz via Python-list
/listinfo/python-list

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

<    46   47   48   49   50   51   52   53   54   55   >