On Sun, 24 Apr 2022 01:19:38 + (UTC), Sunil KR
declaimed the following:
>
>-- Why are my strings being sent to python3, so that I get the unicode related
>error?
>-- in other cases I see error pertaining to the print function
In python2, the default for strings is BYTES -- you must
I am happy with how the python starts up. When I use
python
I get python 2.
I am ok with using py -3 for my new scripts, even using the shebang like
#!py -3
I don't want to put a unix (or for that matter windows) path in the shebang, as
it is not platform portable
But the real question/s for me i
On Sun, 24 Apr 2022 at 10:04, Cameron Simpson wrote:
>
> On 24Apr2022 08:21, Chris Angelico wrote:
> >On Sun, 24 Apr 2022 at 08:18, Cameron Simpson wrote:
> >> An approach I think you both may have missed: mmap the file and use
> >> mmap.rfind(b'\n') to locate line delimiters.
> >> https://docs.
On 24Apr2022 08:21, Chris Angelico wrote:
>On Sun, 24 Apr 2022 at 08:18, Cameron Simpson wrote:
>> An approach I think you both may have missed: mmap the file and use
>> mmap.rfind(b'\n') to locate line delimiters.
>> https://docs.python.org/3/library/mmap.html#mmap.mmap.rfind
>
>Yeah, I made a v
On 23/04/2022 08.35, Michael F. Stemper wrote:
> On 22/04/2022 14.59, Chris Angelico wrote:
>> On Sat, 23 Apr 2022 at 05:56, Michael F. Stemper
>> wrote:
>>>
>>> I'm writing a function that is nearly self-documenting by its name,
>>> but still want to give it a docstring. Which of these would be
>
On Sun, 24 Apr 2022 at 08:18, Cameron Simpson wrote:
>
> On 24Apr2022 07:15, Chris Angelico wrote:
> >On Sun, 24 Apr 2022 at 07:13, Marco Sulla
> >wrote:
> >> Emh, why chunks? My function simply reads byte per byte and compares
> >> it to b"\n". When it find it, it stops and do a readline():
>
On Sun, 24 Apr 2022 at 08:06, dn wrote:
>
> On 24/04/2022 09.15, Chris Angelico wrote:
> > On Sun, 24 Apr 2022 at 07:13, Marco Sulla
> > wrote:
> >>
> >> On Sat, 23 Apr 2022 at 23:00, Chris Angelico wrote:
> > This is quite inefficient in general.
>
> Why inefficient? I think that
On 24Apr2022 07:15, Chris Angelico wrote:
>On Sun, 24 Apr 2022 at 07:13, Marco Sulla wrote:
>> Emh, why chunks? My function simply reads byte per byte and compares
>> it to b"\n". When it find it, it stops and do a readline():
[...]
>> This is only for one line and in utf8, but it can be general
On Sun, 24 Apr 2022 at 08:03, Peter J. Holzer wrote:
>
> On 2022-04-24 04:57:20 +1000, Chris Angelico wrote:
> > On Sun, 24 Apr 2022 at 04:37, Marco Sulla
> > wrote:
> > > What about introducing a method for text streams that reads the lines
> > > from the bottom? Java has also a ReversedLinesFi
On 24/04/2022 09.15, Chris Angelico wrote:
> On Sun, 24 Apr 2022 at 07:13, Marco Sulla
> wrote:
>>
>> On Sat, 23 Apr 2022 at 23:00, Chris Angelico wrote:
> This is quite inefficient in general.
Why inefficient? I think that readlines() will be much slower, not
only more time c
On 2022-04-24 04:57:20 +1000, Chris Angelico wrote:
> On Sun, 24 Apr 2022 at 04:37, Marco Sulla
> wrote:
> > What about introducing a method for text streams that reads the lines
> > from the bottom? Java has also a ReversedLinesFileReader with Apache
> > Commons IO.
>
> It's fundamentally diffi
> I don't know in Python, but maybe you can create a script that writes
> on a named pipe and read it from Python?
> https://askubuntu.com/questions/226278/run-script-on-wakeup
Thanks, that gives me something to munch on.
--
https://mail.python.org/mailman/listinfo/python-list
On 24/04/2022 07.36, Skip Montanaro wrote:
> It's not clear there is a straightforward way to catch a signal or get
> an event notification when my computer (Dell running XUbuntu 20.04) is
> about to sleep or when it's just awakened. The app uses tkinter. Is
> there some more-or-less easy way to do
On Sun, 24 Apr 2022 at 07:13, Marco Sulla wrote:
>
> On Sat, 23 Apr 2022 at 23:00, Chris Angelico wrote:
> > > > This is quite inefficient in general.
> > >
> > > Why inefficient? I think that readlines() will be much slower, not
> > > only more time consuming.
> >
> > It depends on which is more
On Sat, 23 Apr 2022 at 23:00, Chris Angelico wrote:
> > > This is quite inefficient in general.
> >
> > Why inefficient? I think that readlines() will be much slower, not
> > only more time consuming.
>
> It depends on which is more costly: reading the whole file (cost
> depends on size of file) o
On Sun, 24 Apr 2022 at 06:41, Marco Sulla wrote:
>
> On Sat, 23 Apr 2022 at 20:59, Chris Angelico wrote:
> >
> > On Sun, 24 Apr 2022 at 04:37, Marco Sulla
> > wrote:
> > >
> > > What about introducing a method for text streams that reads the lines
> > > from the bottom? Java has also a Reversed
On Sat, 23 Apr 2022 at 20:59, Chris Angelico wrote:
>
> On Sun, 24 Apr 2022 at 04:37, Marco Sulla
> wrote:
> >
> > What about introducing a method for text streams that reads the lines
> > from the bottom? Java has also a ReversedLinesFileReader with Apache
> > Commons IO.
>
> It's fundamentally
I don't know in Python, but maybe you can create a script that writes
on a named pipe and read it from Python?
https://askubuntu.com/questions/226278/run-script-on-wakeup
--
https://mail.python.org/mailman/listinfo/python-list
It's not clear there is a straightforward way to catch a signal or get
an event notification when my computer (Dell running XUbuntu 20.04) is
about to sleep or when it's just awakened. The app uses tkinter. Is
there some more-or-less easy way to do this? Mac support would be nice
(I have my eye on
"return true iff this".
I like this.
jan
On 23/04/2022, Stefan Ram wrote:
> Rob Cliffe writes:
>>I'm curious as to why so many people prefer "Return" to "Returns".
>
> The commands, er, names of functions, use the imperative mood
> ("print", not "prints"). So, "return" aligns with that moo
On Sun, 24 Apr 2022 at 04:37, Marco Sulla wrote:
>
> What about introducing a method for text streams that reads the lines
> from the bottom? Java has also a ReversedLinesFileReader with Apache
> Commons IO.
It's fundamentally difficult to get precise. In general, there are
three steps to reading
On Fri, Apr 22, 2022 at 12:56 PM Michael F. Stemper <
michael.stem...@gmail.com> wrote:
> I'm writing a function that is nearly self-documenting by its name,
> but still want to give it a docstring. Which of these would be
> best from a stylistic point of view:
>
>
>Tells caller whether or not
What about introducing a method for text streams that reads the lines
from the bottom? Java has also a ReversedLinesFileReader with Apache
Commons IO.
--
https://mail.python.org/mailman/listinfo/python-list
Given what you added, Michael, your function is part of a larger collection of
functions and being compatible with the others is a valid consideration.
Whatever you decide, would ideally be done consistently with all or most of
them.
And, of course, it others in the collection also can handle mu
On 22/04/2022 16.12, alister wrote:
On Fri, 22 Apr 2022 14:36:27 -0500, Michael F. Stemper wrote:
I'm writing a function that is nearly self-documenting by its name,
but still want to give it a docstring. Which of these would be best from
a stylistic point of view:
for guidance I would suge
On 22/04/2022 21.58, Avi Gross wrote:
Python does have a concept of "truthy" that includes meaning for not just the
standard Booleans but for 0 and non-zero and the empty string and many more odd things
such as an object that defines __bool__ ().
But saying it returns a Boolean True/False value
On 4/22/22, Tola Oj wrote:
> im trying to upgrade my pip so i can install openpyxl. i though i had
> successfully upgraded pip, and then I was trying to install openpyxl, but I
> was getting this:
>
> C:\Users\ojomo>"C:\Program Files\Python310\python.exe" -m pip install
> --upgrade
>
> [...]
>
> "
27 matches
Mail list logo