Re: new sorting algorithm

2022-05-02 Thread Dan Stromberg
On Mon, May 2, 2022 at 2:25 AM jan via Python-list wrote: > Hi, > > > The median-of-three partitioning technique makes that work reasonably > well, so it won't be pathologically slow > > Just to be clear because I've wondered but haven't looked into it, we > know naive quicksorting of already-sor

Re: error of opening Python

2022-05-02 Thread ARRYAN SINHA (RA1811029010036) via Python-list
On Friday, April 15, 2022 at 2:17:28 AM UTC+5:30, Andrew Hernandez wrote: > that is not an error, its simply the python console intrepeter how do I open this file -- https://mail.python.org/mailman/listinfo/python-list

Re: tail

2022-05-02 Thread Marco Sulla
On Mon, 2 May 2022 at 00:20, Cameron Simpson wrote: > > On 01May2022 18:55, Marco Sulla wrote: > >Something like this is OK? > [...] > >def tail(f): > >chunk_size = 100 > >size = os.stat(f.fileno()).st_size > > I think you want os.fstat(). It's the same from py 3.3 > >chunk_line_pos

Re: new sorting algorithm

2022-05-02 Thread Mats Wichmann
On 5/2/22 07:09, charles hottel wrote: > Some versions of Quicksort switch over to Straight Insertion Sort when > the partitions become small enough. The correct size will vary depending > on the hardware. > > I have not kept up with the latest improvements and I am not familiar > with TimSort. 

Re: tail

2022-05-02 Thread Marco Sulla
Ok, I suppose \n and \r are enough: readline(size=- 1, /) Read and return one line from the stream. If size is specified, at most size bytes will be read. The line terminator is always b'\n' for binary files; for text files, the newline argument to open() can be used to select the line

Re: tail

2022-05-02 Thread Chris Angelico
On Tue, 3 May 2022 at 04:38, Marco Sulla wrote: > > On Mon, 2 May 2022 at 18:31, Stefan Ram wrote: > > > > |The Unicode standard defines a number of characters that > > |conforming applications should recognize as line terminators:[7] > > | > > |LF:Line Feed, U+000A > > |VT:Vertical Tab,

Re: tail

2022-05-02 Thread Marco Sulla
On Mon, 2 May 2022 at 18:31, Stefan Ram wrote: > > |The Unicode standard defines a number of characters that > |conforming applications should recognize as line terminators:[7] > | > |LF:Line Feed, U+000A > |VT:Vertical Tab, U+000B > |FF:Form Feed, U+000C > |CR:Carriage Return, U+0

Re: Fwd: Python Question re Executing a Script (dn)

2022-05-02 Thread MRAB
On 2022-05-02 17:23, Dennis Lee Bieber wrote: On Mon, 2 May 2022 20:33:02 +1200, dn declaimed the following: Perhaps an MS-Win user can help the OP, please? Not really -- at least from my viewpoint there is not enough information to perform any diagnoses... Other than to recommend th

Re: Fwd: Python Question re Executing a Script (dn)

2022-05-02 Thread Dennis Lee Bieber
On Mon, 2 May 2022 20:33:02 +1200, dn declaimed the following: >Perhaps an MS-Win user can help the OP, please? Not really -- at least from my viewpoint there is not enough information to perform any diagnoses... Other than to recommend that, if the OP initially posted to the list/newsgr

Re: new sorting algorithm

2022-05-02 Thread charles hottel
On 5/1/2022 7:45 PM, Chris Angelico wrote: On Mon, 2 May 2022 at 09:20, Dan Stromberg wrote: On Sun, May 1, 2022 at 1:44 PM Chris Angelico wrote: On Mon, 2 May 2022 at 06:43, Dan Stromberg wrote: On Sun, May 1, 2022 at 11:10 AM Chris Angelico wrote: On Mon, 2 May 2022 at 01:53, Nas Ba

Re: new sorting algorithm

2022-05-02 Thread jan via Python-list
Hi, > The median-of-three partitioning technique makes that work reasonably well, so it won't be pathologically slow Just to be clear because I've wondered but haven't looked into it, we know naive quicksorting of already-sorted data is pathalogical, but median-of-3 is known to fix this pathology

Fwd: Python Question re Executing a Script (dn)

2022-05-02 Thread dn
Perhaps an MS-Win user can help the OP, please? -- Regards, =dn--- Begin Message --- Hello dn, Thanks for your reply. My apologies, I should have provided more background information. I was recently running a Windows 10 machine and I believe it was running Python 3.8. All I did was create a