Profilo di

Nome
Indirizzo email ㎝🐌🐍.🇮🇹
AvatarAvatar utenti
Messaggi265
Firma forum
THE 🍺-WARE LICENSE (Revision ㊷):
<㎝🐌🐍.🇮🇹> wrote this post. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you
think this stuff is worth it, you can buy me a 🍺 in return. -- ㎝
  • Re: Confronto tra liste.
    Forum >> Principianti
    oppure

    >>> A = [1, 2, 3, 4]
    >>> B = [3, 4, 5, 6, 7]
    >>> C = [6, 7, 8, 9]
    >>> print(*[f"elemento in comune: {i}" for i in set(A) & set(B)] or ["niente in comune"], sep="\n")
    elemento in comune: 3
    elemento in comune: 4
    >>> print(*[f"elemento in comune: {i}" for i in set(A) & set(C)] or ["niente in comune"], sep="\n")
    niente in comune
    >>> print(*[f"elemento in comune: {i}" for i in set(B) & set(C)] or ["niente in comune"], sep="\n")
    elemento in comune: 6
    elemento in comune: 7
    
    


    THE 🍺-WARE LICENSE (Revision ㊷):
    <㎝🐌🐍.🇮🇹> wrote this post. As long as you retain this notice you
    can do whatever you want with this stuff. If we meet some day, and you
    think this stuff is worth it, you can buy me a 🍺 in return. -- ㎝
  • Re: Variazione sintassi da vers. 3.4 a 3.12
    Forum >> Principianti
    Pietro Bruno Lancerotto said @ 2024-08-30 17:04:48:
    Pensando di aver capito che il tutto era dovuto ad una fantasiosa invenzione per risparmiare qualche carattere ho modificato così

    #if (instance := getattr(cls, inst_field, None)) is None:
    instance = getattr(cls, inst_field, None)
    if instance is None:
    :ok:


    Pietro Bruno Lancerotto said @ 2024-08-30 17:04:48:
    Naturalmente oltrepassa il punto ma si ferma qui

    msg = ['OUTCOME', f' Connessione con {self.svr} stabilita']

    con questa indicazione

    msg = ['OUTCOME', f' Connessione con {self.svr} stabilita']
                                                                 ^
    SyntaxError: invalid syntax
    

    Il cappelletto è in corrispondenza dell'apice a fine parola " stabilita "

    Se avete qualche idea perchè non credo di riuscire ad arrivarci goooglando

    quella cosa f'...' si chiama f-string, ed è stata introdotta in python 3.7

    https://docs.python.org/3.7/tutorial/inputoutput.html
    dovresti poter ottenere un risultato simile con




    msg = ['OUTCOME', ' Connessione con {0} stabilita'.format(self.svr)]


    (untested)

    THE 🍺-WARE LICENSE (Revision ㊷):
    <㎝🐌🐍.🇮🇹> wrote this post. As long as you retain this notice you
    can do whatever you want with this stuff. If we meet some day, and you
    think this stuff is worth it, you can buy me a 🍺 in return. -- ㎝
  • Re: Variazione sintassi da vers. 3.4 a 3.12
    Forum >> Principianti
    if (instance := getattr(cls, inst_field, None)) is None:
                instance = orig_new(cls)
                if hasattr(cls, "__init__"):
                    cls.__init__(instance, *args, **kwargs)
                    delattr(cls, "__init__")
                setattr(cls, inst_field, instance)
            return instance
    senza walrus dovrebbe corrispondere a

    instance = getattr(cls, inst_field, None)
    if instance is None:
                instance = orig_new(cls)
                if hasattr(cls, "__init__"):
                    cls.__init__(instance, *args, **kwargs)
                    delattr(cls, "__init__")
                setattr(cls, inst_field, instance)
            return instance







    THE 🍺-WARE LICENSE (Revision ㊷):
    <㎝🐌🐍.🇮🇹> wrote this post. As long as you retain this notice you
    can do whatever you want with this stuff. If we meet some day, and you
    think this stuff is worth it, you can buy me a 🍺 in return. -- ㎝
  • Re: Variazione sintassi da vers. 3.4 a 3.12
    Forum >> Principianti
    Hai valutato se non ti convenga avviare il pc con un dongle linux lite aggiornato?
    THE 🍺-WARE LICENSE (Revision ㊷):
    <㎝🐌🐍.🇮🇹> wrote this post. As long as you retain this notice you
    can do whatever you want with this stuff. If we meet some day, and you
    think this stuff is worth it, you can buy me a 🍺 in return. -- ㎝
  • Re: sqlite3 in rete
    Forum >> Programmazione Python >> Database
    ti consiglio di seguire gli ottimi suggerimenti in https://kerkour.com/sqlite-for-servers

    (per imperscrutabili ragioni alcuni utenti non raggiungono quella pagina, che è comunque archiviata su https://archive.is/Xfjh6 )


    THE 🍺-WARE LICENSE (Revision ㊷):
    <㎝🐌🐍.🇮🇹> wrote this post. As long as you retain this notice you
    can do whatever you want with this stuff. If we meet some day, and you
    think this stuff is worth it, you can buy me a 🍺 in return. -- ㎝
  • Re: sqlite3 in rete
    Forum >> Programmazione Python >> Database
    Ciao Alberto,

    forse potresti valutare l'utilizzo di https://litesync.io/en/ o https://litestream.io/

    THE 🍺-WARE LICENSE (Revision ㊷):
    <㎝🐌🐍.🇮🇹> wrote this post. As long as you retain this notice you
    can do whatever you want with this stuff. If we meet some day, and you
    think this stuff is worth it, you can buy me a 🍺 in return. -- ㎝
  • Re: Conversione ASCII a HEX
    Forum >> Principianti
    >>> bytes('test', 'utf-8')
    b'test'
    THE 🍺-WARE LICENSE (Revision ㊷):
    <㎝🐌🐍.🇮🇹> wrote this post. As long as you retain this notice you
    can do whatever you want with this stuff. If we meet some day, and you
    think this stuff is worth it, you can buy me a 🍺 in return. -- ㎝
  • Re: Decoratori Python: registrazione personalizzata per chiamate di funzioni
    Forum >> Programmazione Python >> Database
    THE 🍺-WARE LICENSE (Revision ㊷):
    <㎝🐌🐍.🇮🇹> wrote this post. As long as you retain this notice you
    can do whatever you want with this stuff. If we meet some day, and you
    think this stuff is worth it, you can buy me a 🍺 in return. -- ㎝
  • Re: Come installare opentele~=1.15.1 ?
    Forum >> Principianti
    a me sembra funzionare (vedi allegato)


    --- Ultima modifica di ㎝ in data 2023-09-06 22:09:39 ---
    THE 🍺-WARE LICENSE (Revision ㊷):
    <㎝🐌🐍.🇮🇹> wrote this post. As long as you retain this notice you
    can do whatever you want with this stuff. If we meet some day, and you
    think this stuff is worth it, you can buy me a 🍺 in return. -- ㎝
  • Re: AttributeError: partially initialized module 'pygame' has no attribute 'init' (most likely due to a circular import)
    Forum >> Programmazione Python >> Videogames
    File "/home/patrizio/Scaricati/pygame.py", line 3, in <module>
    Sembra che tu abbia un file chiamato `pygame.py` in `~/Scaricati`...

    THE 🍺-WARE LICENSE (Revision ㊷):
    <㎝🐌🐍.🇮🇹> wrote this post. As long as you retain this notice you
    can do whatever you want with this stuff. If we meet some day, and you
    think this stuff is worth it, you can buy me a 🍺 in return. -- ㎝