On 11Nov2020 21:26, Karen Shaeffer wrote:
>import io
>
>with io.open(filename, ‘r’) as fd:
> lines = fd.readlines(hint=1000)
> for line in lines:
> # do something
>
>
>I was just looking at the io module. io.open(‘file’, ‘r') returns an
>io.TextIOWrapper object, which has the io.TextIOW
Hi folks,
import io
with io.open(filename, ‘r’) as fd:
lines = fd.readlines(hint=1000)
for line in lines:
# do something
I was just looking at the io module. io.open(‘file’, ‘r') returns an
io.TextIOWrapper object, which has the io.TextIOWrapper.readlines(hint=-1/)
method.
>>>
On Thu, Nov 12, 2020 at 10:44 AM Dan Stromberg wrote:
>
>
> On Wed, Nov 11, 2020 at 10:38 AM Chris Angelico wrote:
>>
>> On Thu, Nov 12, 2020 at 4:35 AM Dan Stromberg wrote:
>> >
>> > On Wed, Nov 11, 2020 at 3:00 AM j c wrote:
>> >
>> > > Hello all,
>> > >
>> > > I don't know if this suggestion
On Wednesday, 11 November 2020 at 12:22:24 UTC+1, Chris Angelico wrote:
> On Wed, Nov 11, 2020 at 10:06 PM j c wrote:
> >
> > Hello all,
> >
> > I don't know if this suggestion is missing some point, or it's part of
> > something already proposed.
> >
> > In a professional environment, we've
On Wed, Nov 11, 2020 at 10:38 AM Chris Angelico wrote:
> On Thu, Nov 12, 2020 at 4:35 AM Dan Stromberg wrote:
> >
> > On Wed, Nov 11, 2020 at 3:00 AM j c wrote:
> >
> > > Hello all,
> > >
> > > I don't know if this suggestion is missing some point, or it's part of
> > > something already propos
On Thu, Nov 12, 2020 at 4:35 AM Dan Stromberg wrote:
>
> On Wed, Nov 11, 2020 at 3:00 AM j c wrote:
>
> > Hello all,
> >
> > I don't know if this suggestion is missing some point, or it's part of
> > something already proposed before.
> >
> > In a professional environment, we've came to a point i
On 12/11/2020 00:45, Bischoop wrote:
I see now I overcomplicated it, what is a good idea then?
This is a variation on a data-compression technique called
RLE=Run-Length Encoding (excepting that in this case there is no need to
count the repetitions).
Web.Ref:
https://stackabuse.com/run-len
On Wed, Nov 11, 2020 at 3:00 AM j c wrote:
> Hello all,
>
> I don't know if this suggestion is missing some point, or it's part of
> something already proposed before.
>
> In a professional environment, we've came to a point in which most people
> use virtual environments or code environments to
On 2020-11-10 23:32, adelamsaleh--- via Python-list wrote:
Dear Python Community,
I am new to python. I sucessfully installed python 3.9 from python.org on my
windows 10 pc.
I checked it by typing 'py' in the windows cmd prompt and the system indeed responds
with the version number, then the >
10.11.20 11:07, Manfred Lotz пише:
> Perhaps better. I like to use os.scandir this way
>
> def scantree(path: str) -> Iterator[os.DirEntry[str]]:
> """Recursively yield DirEntry objects (no directories)
> for a given directory.
> """
> for entry in os.scandir(path):
>
10.11.20 22:40, Dennis Lee Bieber пише:
> Testing for extension in a list of exclusions would be much faster than
> scanning the contents of a file, and the few that do get through would have
> to be scanned anyway.
Then the simplest method should work: read the first 512 bytes and check
if
11.11.20 02:46, Skip Montanaro пише:
> I can think of two reasons. One, this kind of comparison will almost never
> appear in production code (maybe in unit tests?). Unlike the C family of
> languages, Python doesn't have a macro processor which would give symbolic
> names to numeric constants or s
Dear Python Community,
I am new to python. I sucessfully installed python 3.9 from python.org on my
windows 10 pc.
I checked it by typing 'py' in the windows cmd prompt and the system indeed
responds with the version number, then the >>> prompt, and I can run simple
programs without any problem
On 2020-11-11, MRAB wrote:
>>
> Points to note in your first code:
>
> 1. Modifying a list while iterating over it is a bad idea.
>
> 2. You're modifying the list that you're passing in and also returning
> it. That's a bad idea. Either modify it in place or modify and return a
> copy.
>
> 3. T
On Wed, Nov 11, 2020 at 10:06 PM j c wrote:
>
> Hello all,
>
> I don't know if this suggestion is missing some point, or it's part of
> something already proposed.
>
> In a professional environment, we've came to a point in which most people use
> virtual environments or conda environments to av
Hello all,
I don't know if this suggestion is missing some point, or it's part of
something already proposed.
In a professional environment, we've came to a point in which most people use
virtual environments or conda environments to avoid "polluting a global
environment".
However, I think th
Hello all,
I don't know if this suggestion is missing some point, or it's part of
something already proposed before.
In a professional environment, we've came to a point in which most people use
virtual environments or code environments to avoid "polluting a global
environment".
However, I th
17 matches
Mail list logo