Re: difficult start with asyncio async/await

2022-03-23 Thread lacsaP Patatetom
S') + ' looping...', 'red')) tasks = [ runItems(url) for url in urls ] tasks and await asyncio.gather(*tasks) await asyncio.sleep(30) asyncio.run(loopForever()) ``` do you think this is the right way for what I want to do ? regards, lacsaP.

difficult start with asyncio async/await

2022-03-23 Thread lacsaP Patatetom
hi, difficult start with asyncio async/await... I'm trying to make a mockup that queries a few sites and posts the results to a server, but the result is not what I expected. I was expecting to get the 4 "get" one after the other, followed by the "post" (eventually mixed) but I get something t

Re: fileinput

2019-10-29 Thread patatetom
Le mardi 29 octobre 2019 10:34:22 UTC+1, Inada Naoki a écrit : > When you are reading file from stdin, fileinput doesn't open the file. > Python open the stdin. So openhook doesn't affect to stdin. > > You can use stdin.reconfigure() to change encoding and error handler > of the stdin. > > On Tu

Re: fileinput

2019-10-29 Thread patatetom
Le lundi 28 octobre 2019 11:48:29 UTC+1, Peter J. Holzer a écrit : > On 2019-10-25 22:12:23 +0200, Pascal wrote: > > for line in fileinput.input(source): > > print(line.strip()) > > > > --- > > > > python3.7.4 myscript.py myfile.log > > Traceback (most recent call last): >

Re: fileinput

2019-10-27 Thread patatetom
Le samedi 26 octobre 2019 17:49:57 UTC+2, Peter Otten a écrit : > Pascal wrote: > > > I have a small python (3.7.4) script that should open a log file and > > display its content but as you can see, an encoding error occurs : > > > > --- > > > > import fileinput > > import sy

Re: read function of fuse

2018-03-03 Thread patatetom
after a few tests, it appears that the file is read in pieces: read[0] 131072 bytes from 0 flags: 0x8000 read[0] 131072 bytes from 131072 flags: 0x8000 read[0] 131072 bytes from 262144 flags: 0x8000 ... read[0] 8192 bytes from 917504 flags: 0x8000 read[0] 4096 bytes from 925696 flags: 0x8000 so t

read function of fuse

2018-03-03 Thread patatetom
on of the xtaffuse module returns directly the generator from the readFile function of the xb360hd module, I have the error "object of type' generator' has no len ()" / I don't want to use a temporary file between readFile of the xb360hd module and read of the xtaffuse mod