Search found 60 matches

by VladVons
Sun Apr 03, 2022 5:43 pm
Forum: General Discussion and Questions
Topic: bug in constructor with default value. [SOLVED]
Replies: 5
Views: 1849

Re: bug in constructor with default value.

the responsibility of using 'copy()' lays on python byte compiler. to reduce data segment the interpreter should control itself uniq values stored in hash table. to best unerstanding see internal id() function. though, the example with 'str' type works correct. class TClass1(): def __init__(self, aN...
by VladVons
Sun Apr 03, 2022 11:44 am
Forum: General Discussion and Questions
Topic: bug in constructor with default value. [SOLVED]
Replies: 5
Views: 1849

bug in constructor with default value. [SOLVED]

I found a bug in constructor with default value. In last line aData should be [], but not a 100. This problem also occures on Linux, Windows. import sys class TClass1(): def __init__(self, aName: str, aData: list = []): print('aName:', aName, 'aData:', aData) self.Data = aData print() print('python ...
by VladVons
Mon Feb 22, 2021 7:35 pm
Forum: ESP32 boards
Topic: ESP32 and LilyGo TTGO T Call
Replies: 21
Views: 18154

Re: ESP32 and LilyGo TTGO T Call

Hello kinno I have got such device and also good micropython skill. https://www.aliexpress.com/item/4000832675119.html Can you share your source code or pair examles/subject links as start point to serve GSM, GPS modules ? I have a ton of code written for this. Anything in particular you want? I wou...
by VladVons
Fri Feb 19, 2021 3:38 pm
Forum: ESP8266 boards
Topic: random.randint() not exists in esp8266 ?
Replies: 4
Views: 2707

Re: random.randint() not exists in esp8266 ?

thanks Christian
got it
by VladVons
Fri Feb 19, 2021 1:04 pm
Forum: ESP8266 boards
Topic: random.randint() not exists in esp8266 ?
Replies: 4
Views: 2707

random.randint() not exists in esp8266 ?

in ESP32 there is a random.randint() function
in ESP866 no.

how to get any randomize value in ESP866 ?
by VladVons
Sun Feb 14, 2021 2:52 pm
Forum: ESP8266 boards
Topic: [SOLVED] async read keypressed in terminal
Replies: 5
Views: 6483

Re: async read keypressed in terminal

Peter, no theme in internet Hope I`m on a right way with select.poll() class TKbdTerm(): def __init__(self): self.Poller = select.poll() self.Poller.register(sys.stdin, select.POLLIN) def GetChr(self): for s, ev in self.Poller.poll(500): return s.read(1) async def Input(self, aPrompt = ''): R = '' w...
by VladVons
Thu Feb 04, 2021 8:14 pm
Forum: General Discussion and Questions
Topic: [SOLVED] Multipart files upload. File length?
Replies: 2
Views: 1570

Re: Multipart files upload. How to get the file length or its data?

thanks jimmo my async multiple files upload implementation import uasyncio as asyncio class TMulUpload(): @staticmethod def ParseRec(aStr: str) -> dict: Res = {} for Item in aStr.split(';'): Arr = Item.split('=') if (len(Arr) == 2): Res[Arr[0].strip().lower()] = Arr[1].strip() else: Res[Item.strip()...
by VladVons
Wed Feb 03, 2021 1:51 pm
Forum: General Discussion and Questions
Topic: [SOLVED] Multipart files upload. File length?
Replies: 2
Views: 1570

[SOLVED] Multipart files upload. File length?

i upload two files and dont know how to get thier context length and data should i search in POST every time data boundary ? ----WebKitFormBoundarywjRojsBoPY7GpAWu is there some 'BOUNDARY-content-length' like a HTTP head content-length ? there are many heavy weight python libraries that handles file...
by VladVons
Wed Feb 03, 2021 8:59 am
Forum: General Discussion and Questions
Topic: url decode
Replies: 4
Views: 14482

Re: url decode

def UrlPercent(aData: bytearray) -> str: Bits = aData.split(b'%') Arr = [Bits[0]] for Item in Bits[1:]: Code = Item[:2] Char = bytes([int(Code, 16)]) Arr.append(Char) Arr.append(Item[2:].replace(b'+', b' ')) Res = b''.join(Arr) return Res.decode('utf-8') see also https://github.com/micropython/micr...
by VladVons
Mon Feb 01, 2021 2:16 pm
Forum: ESP32 boards
Topic: microwebsrv2 : not enought memory !
Replies: 3
Views: 2025

Re: microwebsrv2 : not enought memory !

indeed microwebsrv2 is not a micro. it has over 4000 lines of source code. on esp32 should work, but memory info needed to say something. perhapse your download file is too big to fit in memory and server loads it into memory instead of splitting into portions of streaming. Memory usage: import gc g...