We did it, team!! After quite a bumpy release process and a bunch of
last-time fixes, we have reached **beta 1** and **feature freeze**. What a
ride eh? You can get the shiny new release artefacts from here:
https://www.python.org/downloads/release/python-3110b1/
## This is a beta preview of Pyth
On Sun, 8 May 2022 at 07:19, Stefan Ram wrote:
>
> MRAB writes:
> >On 2022-05-07 19:47, Stefan Ram wrote:
> ...
> >>def encoding( name ):
> >>path = pathlib.Path( name )
> >>for encoding in( "utf_8", "latin_1", "cp1252" ):
> >>try:
> >>with path.open( encoding=encoding
On 2022-05-06, dn wrote:
> The problem with some of the advice given in this thread, eg using
> StackOverflow or YouTube videos, is that a beginner (particularly)
> has no measure of the material's quality. Both platforms are riddled
> with utter-junk - even 'dangerous' advice.
And the "quality
On Sun, 8 May 2022 at 04:37, Marco Sulla wrote:
>
> On Sat, 7 May 2022 at 19:02, MRAB wrote:
> >
> > On 2022-05-07 17:28, Marco Sulla wrote:
> > > On Sat, 7 May 2022 at 16:08, Barry wrote:
> > >> You need to handle the file in bin mode and do the handling of line
> > >> endings and encodings yo
On 2022-05-07 19:47, Stefan Ram wrote:
Marco Sulla writes:
Well, ok, but I need a generic method to get LF and CR for any
encoding an user can input.
"LF" and "CR" come from US-ASCII. It is theoretically
possible that there might be some encodings out there
(not for Unicode) that are
On 2022-05-07 19:35, Marco Sulla wrote:
On Sat, 7 May 2022 at 19:02, MRAB wrote:
>
> On 2022-05-07 17:28, Marco Sulla wrote:
> > On Sat, 7 May 2022 at 16:08, Barry wrote:
> >> You need to handle the file in bin mode and do the handling of line
endings and encodings yourself. It’s not that hard
On Sat, 7 May 2022 20:35:34 +0200, Marco Sulla
declaimed the following:
>Well, ok, but I need a generic method to get LF and CR for any
>encoding an user can input.
Other than EBCDIC, and AS BYTES should appear as x0A and x0D
in any of the 8-bit encodings (ASCII, ISO-8859-x, CP, UT
On Sat, 7 May 2022 at 19:02, MRAB wrote:
>
> On 2022-05-07 17:28, Marco Sulla wrote:
> > On Sat, 7 May 2022 at 16:08, Barry wrote:
> >> You need to handle the file in bin mode and do the handling of line
> >> endings and encodings yourself. It’s not that hard for the cases you
> >> wanted.
> >
On 2022-05-07 17:28, Marco Sulla wrote:
On Sat, 7 May 2022 at 16:08, Barry wrote:
You need to handle the file in bin mode and do the handling of line endings and
encodings yourself. It’s not that hard for the cases you wanted.
"\n".encode("utf-16")
b'\xff\xfe\n\x00'
"".encode("utf-16")
b
I believe I'd do something like:
#!/usr/local/cpython-3.10/bin/python3
"""
Output the last 10 lines of a potentially-huge file.
O(n). But technically so is scanning backward from the EOF.
It'd be faster to use a dict, but this has the advantage of working for
huge num_lines.
"""
import d
On Sat, 7 May 2022 at 16:08, Barry wrote:
> You need to handle the file in bin mode and do the handling of line endings
> and encodings yourself. It’s not that hard for the cases you wanted.
>>> "\n".encode("utf-16")
b'\xff\xfe\n\x00'
>>> "".encode("utf-16")
b'\xff\xfe'
>>> "a\nb".encode("utf-16
On Sat, May 7, 2022 at 3:29 AM Peter J. Holzer wrote:
>
> On 2022-05-07 14:07:53 +1200, Greg Ewing wrote:
> > On 7/05/22 12:27 pm, Stefan Ram wrote:
> > >So, one might actually be able to learn the pronunciation
> > >of a foreign language from text in a book better than from
> > >an au
> On 7 May 2022, at 14:24, Marco Sulla wrote:
>
> On Sat, 7 May 2022 at 01:03, Dennis Lee Bieber wrote:
>>
>>Windows also uses for the EOL marker, but Python's I/O system
>> condenses that to just internally (for TEXT mode) -- so using the
>> length of a string so read to compute a
Marco,
I think it was made clear from the start that "text" files in the classic sense
have no random access method at any higher level than reading a byte at some
offset from the beginning of the file, or back from the end when it has not
grown.
The obvious fact is that most of the time the li
On Sat, 7 May 2022 at 01:03, Dennis Lee Bieber wrote:
>
> Windows also uses for the EOL marker, but Python's I/O system
> condenses that to just internally (for TEXT mode) -- so using the
> length of a string so read to compute a file position may be off-by-one for
> each EOL in the stri
On 2022-05-07 14:07:53 +1200, Greg Ewing wrote:
> On 7/05/22 12:27 pm, Stefan Ram wrote:
> >So, one might actually be able to learn the pronunciation
> >of a foreign language from text in a book better than from
> >an audio tape (or an audio file or a video with sound)!
>
> Such books
On 06May2022 14:11, Loris Bennett wrote:
>r...@zedat.fu-berlin.de (Stefan Ram) writes:
>> If you need a class, you can write a class.
>>
>> When one imports a module, the module actually gets executed.
>> That's why people write "if __name__ == '__main__':" often.
>> So, everything one wan
17 matches
Mail list logo