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?
>
>
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('
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
&
eason it has to
lose data.
--
Greg
--
https://mail.python.org/mailman/listinfo/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
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
y' contains the following
import configparser
config = configparser.ConfigParser()
try:
config.read('/foo/bar')
except FileNotFoundError as e:
print(f"Error: configuration file {config_file} not found: {e}")
them
python3 missingfile.py
does not produce an any output for me and so does not seem to be a
reliable way of handling the case where the config file does not exist.
Cheers,
Loris
--
This signature is currently under constuction.
--
https://mail.python.org/mailman/listinfo/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?
>
>
to stderr? Quite apart
from that, I find having a log file a useful for debugging when I am
developing.
Cheers,
Loris
> On Mon, Nov 11, 2024 at 4:00 PM Loris Bennett via Python-list
> wrote:
>>
>> Hi,
>>
>> I have the following in my program:
>>
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
l.python.org/mailman/listinfo/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
. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
https://www.egenix.com/company/contact/
https://www.malemburg.com/
--
https://mail.python.org/mailman/listinfo/python-list
--
This signature is currently under constuction.
--
https://mail.python.org/mailman/listinfo/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
dd such endpoint? If so, how?
Cheers,
Loris
--
This signature is currently under constuction.
--
https://mail.python.org/mailman/listinfo/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
n.org/3/library/quopri.html
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/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
&
boatload of documentation of site path configuration, but
still, I am not sure what option to take.
Recommendations are invited and welcome.
Thanks
--
Tim
thjmm...@gmail.com
--
https://mail.python.org/mailman/listinfo/python-list
pt` 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 defined - the except action
>itself is fine in that regard.
The original exception likely tells us which file was not found.
--
https://mail.python.org/mailman/listinfo/python-list
? I'm not a
friend of things so deep in the system...
Greetings
Ulrich
--
Ulrich Goebel
--
https://mail.python.org/mailman/listinfo/python-list
the past I did build newer Python versions
(mostly on raspberry pi’s)
Regards
Alexander
Alexander Neilson
Neilson Productions Limited
021 329 681
alexan...@neilson.net.nz
> On 19 Sep 2024, at 10:42, Ulrich Goebel via Python-list
> wrote:
>
> Hi,
>
> Debian Linux seems
> 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
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
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.
Even before your code gets big
ion and keep it to hand for your use outside the thread.
> ___
> Tutor maillist - tu...@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
--
https://mail.python.org/mailman/listinfo/python-list
if it becomes
set.
You just need a per-thred vent instead of a single Event for all the
threads.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
How to create a per-thread event in Python 2.7?
On Wed, 25 Sept 2024, 22:47 Cameron Simpson via Python-list, <
python-list@python.org> wrote:
> On 25Sep2024 19:24, marc nicole wrote:
> >I want to know how to kill a specific running thread (say by its id)
> >
> >for
omputation graph which
takes space but is faster. For function: f:R^m->R, they can run in
O(m^0)=O(1) time and vice versa ( O(m) time for f:R->R^m ).
Almost all neural network training these days use reverse-mode autodiff.
--
https://mail.python.org/mailman/listinfo/python-list
ou bust out those "next-level math tricks"
> with just a single line each!
You might like:
https://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf
The numerics stuff starts on page 9.
--
https://mail.python.org/mailman/listinfo/python-list
On 25Sep2024 22:56, marc nicole wrote:
How to create a per-thread event in Python 2.7?
Every time you make a Thread, make an Event. Pass it to the thread
worker function and keep it to hand for your use outside the thread.
--
https://mail.python.org/mailman/listinfo/python-list
just the design of threads.
On Wed, Sep 25, 2024 at 7:26 PM marc nicole via Python-list
wrote:
>
> Hello guys,
>
> I want to know how to kill a specific running thread (say by its id)
>
> for now I run and kill a thread like the following:
> # start thread
> thread1 = threading
n2_to_mock` won't call `function1_to_mock` (or its mock)
regardless of whether `function1_to_mock` has been patched, unless you
set the mock of `function2_to_mock` to do so. You don't necessarily
need to patch `function1_to_mock`, unless of course there are other
calls to it that you need to mock.
--
Mark.
--
https://mail.python.org/mailman/listinfo/python-list
On 20Sep2024 12:52, Martin Nilsson wrote:
The attached program doesn’t work in 3.12.5, but in 3.9 it worked.
This mailing list discards attachments.
Please include your code inline in the message text.
Thanks,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
GnuPG
--
https://mail.python.org/mailman/listinfo/python-list
Dear Sirs !
The attached program doesn’t work in 3.12.5, but in 3.9 it worked.
Best Regards
Martin Nilsson
--
https://mail.python.org/mailman/listinfo/python-list
under constuction.
--
https://mail.python.org/mailman/listinfo/python-list
ith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
--
https://mail.python.org/mailman/listinfo/python-list
On 9/30/2024 11:30 AM, Barry via Python-list wrote:
On 30 Sep 2024, at 06:52, Abdur-Rahmaan Janhangeer via Python-list
wrote:
import polars as pl
pl.read_json("file.json")
This is not going to work unless the computer has a lot more the 60GiB of RAM.
As later suggested a
On 2024-09-30, Left Right via Python-list wrote:
> Whether and to what degree you can stream JSON depends on JSON
> structure. In general, however, JSON cannot be streamed (but commonly
> it can be).
>
> Imagine a pathological case of this shape: 1... <60GB of digits>. Th
On Tue, 1 Oct 2024 at 02:20, Thomas Passin via Python-list
wrote:
>
> On 9/30/2024 11:30 AM, Barry via Python-list wrote:
> >
> >
> >> On 30 Sep 2024, at 06:52, Abdur-Rahmaan Janhangeer via Python-list
> >> wrote:
> >>
> >>
4 at 8:44 AM Asif Ali Hirekumbi via Python-list
wrote:
>
> Thanks Abdur Rahmaan.
> I will give it a try !
>
> Thanks
> Asif
>
> On Mon, Sep 30, 2024 at 11:19 AM Abdur-Rahmaan Janhangeer <
> arj.pyt...@gmail.com> wrote:
>
> > Idk if you tried Polars, but i
h time and costs :::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
https://www.egenix.com/company/contact/
https://www.malemburg.com/
--
https://mail.python.org/mailman/listinfo/python-list
to the Python
Software Foundation.
Regards from a positively *melting* Menlo Park for some reason
<https://social.coop/@Yhg1s/113051321976759729>this time,
Your release team,
Thomas Wouters
Łukasz Langa
Ned Deily
Steve Dower
--
https://mail.python.org/mailman/listinfo/python-list
On 9/30/2024 1:00 PM, Chris Angelico via Python-list wrote:
On Tue, 1 Oct 2024 at 02:20, Thomas Passin via Python-list
wrote:
On 9/30/2024 11:30 AM, Barry via Python-list wrote:
On 30 Sep 2024, at 06:52, Abdur-Rahmaan Janhangeer via Python-list
wrote:
import polars as pl
pl.read_json
On 2024-09-30 at 11:44:50 -0400,
Grant Edwards via Python-list wrote:
> On 2024-09-30, Left Right via Python-list wrote:
> > Whether and to what degree you can stream JSON depends on JSON
> > structure. In general, however, JSON cannot be streamed (but commonly
> > it can b
On Tue, 1 Oct 2024 at 04:30, Dan Sommers via Python-list
wrote:
>
> But why do I need to start with the least
> significant digit?
If you start from the most significant, you don't know anything about
the number until you finish parsing it. There's almost nothing you can
say a
On 9/30/2024 11:30 AM, Barry via Python-list wrote:
On 30 Sep 2024, at 06:52, Abdur-Rahmaan Janhangeer via Python-list
wrote:
import polars as pl
pl.read_json("file.json")
This is not going to work unless the computer has a lot more the 60GiB of RAM.
As later suggested a
On 2024-10-01 at 09:09:07 +1000,
Chris Angelico via Python-list wrote:
> On Tue, 1 Oct 2024 at 08:56, Grant Edwards via Python-list
> wrote:
> >
> > On 2024-09-30, Dan Sommers via Python-list wrote:
> >
> > > In Common Lisp, integers can be written in any inte
On 2024-09-30 at 18:48:02 -0700,
Keith Thompson via Python-list wrote:
> 2qdxy4rzwzuui...@potatochowder.com writes:
> [...]
> > In Common Lisp, you can write integers as #nnR[digits], where nn is the
> > decimal representation of the base (possibly without a leading zero),
&
igned to be streamed. So, that's not a
> problem (in principle), but you would need to have a streaming GZip
> parser, quick search in PyPI revealed this package:
> https://pypi.org/project/gzip-stream/ .
>
> On Mon, Sep 30, 2024 at 6:20 PM Thomas Passin via Python-list
> wro
ase. So the input #16f is read as the integer 65535.
Typo: You meant #16R, not #16f.
--
Keith Thompson (The_Other_Keith) keith.s.thompso...@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
--
https://mail.python.org/mailman/listinfo/python-list
On 2024-09-30 at 21:34:07 +0200,
Regarding "Re: Help with Streaming and Chunk Processing for Large JSON Data (60
GB) from Kenna API,"
Left Right via Python-list wrote:
> > What am I missing? Handwavingly, start with the first digit, and as
> > long as the next character
ould need to have a streaming GZip
parser, quick search in PyPI revealed this package:
https://pypi.org/project/gzip-stream/ .
On Mon, Sep 30, 2024 at 6:20 PM Thomas Passin via Python-list
wrote:
>
> On 9/30/2024 11:30 AM, Barry via Python-list wrote:
> >
> >
> >> On 30 Se
On 2024-09-30, Dan Sommers via Python-list wrote:
> On 2024-09-30 at 11:44:50 -0400,
> Grant Edwards via Python-list wrote:
>
>> On 2024-09-30, Left Right via Python-list wrote:
>> > [...]
>> > Imagine a pathological case of this shape: 1... <60GB of digits&g
On 2024-09-30, Dan Sommers via Python-list wrote:
> In Common Lisp, integers can be written in any integer base from two
> to thirty six, inclusive. So knowing the last digit doesn't tell
> you whether an integer is even or odd until you know the base
> anyway.
I had to think
On Tue, 1 Oct 2024 at 08:56, Grant Edwards via Python-list
wrote:
>
> On 2024-09-30, Dan Sommers via Python-list wrote:
>
> > In Common Lisp, integers can be written in any integer base from two
> > to thirty six, inclusive. So knowing the last digit doesn't tell
>
On 2024-10-01 at 04:46:35 +1000,
Chris Angelico via Python-list wrote:
> On Tue, 1 Oct 2024 at 04:30, Dan Sommers via Python-list
> wrote:
> >
> > But why do I need to start with the least
> > significant digit?
>
> If you start from the most significant, you d
to sync _everything_ (and it hurts!)
On Tue, Oct 1, 2024 at 5:49 PM Dan Sommers via Python-list
wrote:
>
> On 2024-09-30 at 21:34:07 +0200,
> Regarding "Re: Help with Streaming and Chunk Processing for Large JSON Data
> (60 GB) from Kenna API,"
> Left Right via Python-lis
written little
endian instead of big endian, but the same argument applies either
way.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 9/18/24 08:49, Ulrich Goebel via Python-list wrote:
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 r
On 9/18/2024 10:49 AM, Ulrich Goebel via Python-list wrote:
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
()
event_thread1.set()
I know that set() will kill all running threads, but if there was thread2
as well and I want to kill only thread1?
Thanks!
--
https://mail.python.org/mailman/listinfo/python-list
s of
> symbols of the alphabet of fixed length. This is, essentially, like
> saying that the words themselves are regular.
One single IP packet is all you can parse. You're playing shenanigans
with words the way Humpty Dumpty does. IP packets are not sequences,
they are individuals.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
_Py_EnsureTstateNotNULL(tstate);
#endif
# <<--- suspect state is nullpointer
return tstate->interp;
}
any clues , whats going on here, and how I can mitigate that ?
--
https://mail.python.org/mailman/listinfo/python-list
P packet is all you can parse. You're playing shenanigans
> with words the way Humpty Dumpty does. IP packets are not sequences,
> they are individuals.
>
> ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
rates the problem?
Louis
--
https://mail.python.org/mailman/listinfo/python-list
that there's no way to tell if my notion of streaming
is correct or not.
But, for the future reference: my notion of streaming is correct, and
you would do better learning some materials about it before jumping to
conclusions.
--
https://mail.python.org/mailman/listinfo/python-list
#x27;d
typically study in automata theory class. Well, not exactly in the
very same words, but you should be able to figure this stuff out if
you had that class.
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 2 Oct 2024 at 23:53, Left Right via Python-list
wrote:
> In the same email you replied to, I gave examples of languages for
> which parsers can be streaming (in general): SCSI or IP.
You can't validate an IP packet without having all of it. Your notion
of "streaming
This thread is derailing.
Please consider it closed.
--
~Ethan~
Moderator
--
https://mail.python.org/mailman/listinfo/python-list
er in that respect.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
Op 5/11/2024 om 15:48 schreef 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 "
think.
BTW you have to be careful testing this, because the compiler sometimes
does constant folding, so you need to be sure it's actually computing
the numbers at run time.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
how to correct my code. Hence, this
call for help.
Any ideas?
TIA
/Martin
--
https://mail.python.org/mailman/listinfo/python-list
on found for first-package<2.0.0,>=1.6.0 (from
second-package==0.5.0)
What version number does first-package have?
The caret in the specification "^1.6.0" restricts it to 1.x.x versions.
If you don't want that restriction, use ">=" instead.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
ength of a
program would be measured by the time needed
to understand it, some programs are too short
to be short."
bye,
--
piergiorgio
--
https://mail.python.org/mailman/listinfo/python-list
t to 1.x.x versions.
>
> If you don't want that restriction, use ">=" instead.
The first package has the version number 1.6.0.
--
This signature is currently under constuction.
--
https://mail.python.org/mailman/listinfo/python-list
thing like -5 to
256 I think.
BTW you have to be careful testing this, because the compiler sometimes
does constant folding, so you need to be sure it's actually computing
the numbers at run time.
--
https://mail.python.org/mailman/listinfo/python-list
umbers at run time.
--
https://mail.python.org/mailman/listinfo/python-list
ed to be something like
-5 to 256 I think.
BTW you have to be careful testing this, because the compiler
sometimes does constant folding, so you need to be sure it's actually
computing the numbers at run time.
--
https://mail.python.org/mailman/listinfo/python-list
this behavior is because python's integers are immutable.
Nothing to do with that.
++x or x++ will redefine 5 to 6, which the interpreter forbids ...
One of those is actually syntactically valid.
It just won’t do what you expect it to do.
--
https://mail.python.org/mailman/listinfo/python-list
++ and ++x, it avoids the pre-
and post-increment (substitute-increment v. increment-substitute) bugs
that plagues C and it's children.
--
https://mail.python.org/mailman/listinfo/python-list
r of that little treatise.
--
https://mail.python.org/mailman/listinfo/python-list
at the exception details: they should tell you what really
> was not found (maybe the directory for the logfile).
It is possible a directory along the path does not exist.
--
regards,
kushal
--
https://mail.python.org/mailman/listinfo/python-list
On 11/12/24 12:10 PM, Left Right via Python-list wrote:
> But, it's
> impossible to reliably rotate a log file. There's always a chance
> that during the rotation some log entries will be written to the file
> past the point of rotation, but prior to the point where the nex
never once worried about problems GNU tail
> might have with a file that gets rotated out from under you. Not sure
> why the author is so fixated on it.
I really wouldn't worry about anything Jonathan de Boyne Pollard says.
--
https://mail.python.org/mailman/listinfo/python-list
On 11/13/24 23:03, Left Right via Python-list wrote:
>> On any Unix system this is untrue. Rotating a log file is quite simple:
>
> I realized I posted this without cc'ing the list:
> http://jdebp.info/FGA/do-not-use-logrotate.html .
>
> The link above gives a more d
ow I perform multiple checks at each if or while statement, but is
there a IO async based method that breaks out of the loop when the event is
raised in the thread?
--
https://mail.python.org/mailman/listinfo/python-list
#x27;name'] is $person['mood']
#end for
Oleg.
--
Oleg Broytmanhttps://phdru.name/p...@phdru.name
Programmers don't die, they just GOSUB without RETURN.
--
https://mail.python.org/mailman/listinfo/python-list
hile the latter are :)
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 14 Nov 2024 at 18:05, Left Right via Python-list
wrote:
>
> > On any Unix system this is untrue. Rotating a log file is quite simple:
>
> I realized I posted this without cc'ing the list:
> http://jdebp.info/FGA/do-not-use-logrotate.html .
>
> The lin
hell gives you a really, really simple
> way of redirecting stderr to a file. So, really, there aren't any
> excuses to do that.
I don't quite understand what your suggestion is. Do you mean that I
should log to stderr and then run my program as
my_program ... 2>&1 | logger
?
Cheers,
Loris
--
This signature is currently under constuction.
--
https://mail.python.org/mailman/listinfo/python-list
://www.malemburg.com/
--
https://mail.python.org/mailman/listinfo/python-list
On 11/13/24 02:12, Roel Schroeven via Python-list wrote:
What I most often do is use one logfile per day, with the date in the
filename. Then simply delete all files older than 7 days, or 30 days, or
whatever is useful for the task at hand. Not only does that sidestep any
issues with rotating
def __new__(cls, whatever, arguments, you, like):
bytesvalue = compute(whatever, arguments, you, like)
ob = bytes.__new__(cls, bytesvalue)
ob.some_other_att = compute_something_else(whatever, arguments, you,
like)
return ob
regards,
Anders
--
https://mail.python.org/mailman/listinfo/python-list
Op 3/12/2024 om 10:41 schreef Roel Schroeven via Python-list:
[...]
When I try the same with bytes as base class though, that doesn't work
(at least in the Python version I'm using, which is CPython 3.11.2
64-bit on Windows 10):
class MyBytes(bytes):
def __init__(
Op 3/12/2024 om 13:55 schreef Anders Munch via Python-list:
Roel Schroeven wrote:
> As a follow-up, it looks like this behavior is because bytes and int are
immutable.
Yes.
OK.
> But that doesn't tell me why using super().__init__()
doesn't work for immutable classes.
byt
ut conversely, the dolphins had always believed that they were far more
intelligent than man — for precisely the same reasons."
-- Douglas Adams
--
https://mail.python.org/mailman/listinfo/python-list
5101 - 5200 of 5793 matches
Mail list logo