Profilo di

Nome
Indirizzo email ㎝🐌🐍.🇮🇹
AvatarAvatar utenti
Messaggi248
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: TypeError: Dog() takes no arguments
    Forum >> Principianti
    manca una t.
    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: File di testo non scritto
    Forum >> Programmazione Python >> Files e Directory
    hai chiuso il file?
    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: Estrarre csv da pdf
    Forum >> Programmazione Python >> Files e Directory
    prova con
    import pdftotext
    import csv
    
    
    with open("18567.pdf", "rb") as pdf_file:
        pdf = pdftotext.PDF(pdf_file)
    
    lines = pdf[0].splitlines()[20:23]
    
    table = []
    
    for line in lines:
        table.append(line.split())
    
    with open("prova2pdf.csv", "w") as csv_file:
        writer = csv.writer(csv_file, delimiter=";")
        writer.writerows(table)
    
    

    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: Composizione lista con errore non segnalato???
    Forum >> Principianti
    >>> l = ['pippo' 'pluto', 'paperino']
    >>> l
    >>> ['pippopluto','paperino']

    Non rileva l'assenza della virgola. Ma e' un bug??? Di certo e' difficile accorgersi dell'errore.
    No, è una feature :P, ereditata da C. Esiste un Rejected PEP per rimuoverla

    https://www.python.org/dev/peps/pep-3126/

    Concordo sulla difficoltà di intercettare eventuali errori; al momento, la soluzione migliore è il plugin
    https://pypi.org/project/flake8-no-implicit-concat/

    $ echo "names = ['pippo' 'pluto', 'paperino']" > eugenio.py
    $ flake8 eugenio.py 
    $ pip install flake8-no-implicit-concat
    Collecting flake8-no-implicit-concat
    [...]
    $ flake8 eugenio.py 
    eugenio.py:1:17: NIC001 Implicitly concatenated string literals
    



    HTH, HAND




    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: Data salvata in un formato che non capisco
    Forum >> Principianti
    >>> from datetime import datetime
    >>> datetime.fromtimestamp(1609614000000 // 1000)
    datetime.datetime(2021, 1, 2, 20, 0)
    >>> datetime.fromtimestamp(1609873200000 // 1000)
    datetime.datetime(2021, 1, 5, 20, 0)
    >>> datetime.fromtimestamp(1610046000000 // 1000)
    datetime.datetime(2021, 1, 7, 20, 0)
    >>> datetime.fromtimestamp(1610218800000 // 1000)
    datetime.datetime(2021, 1, 9, 20, 0)
    
    👋


    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: lettere e numeri
    Forum >> Principianti
    ...     try:
    ...         prova = int(input("Inserisci la pw: "))
    ...     except ValueError:
    ...         print("NO, devi inserire dei numeri, non lettere.")
    ...         continue
    
    👋


    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: stampare due sequenze di numeri di cui una incrementata
    Forum >> Principianti
    oppure anche

    >>> for i in range(10):
    ...     print(i + 1, 4 * i + 1)
    ...     
    1 1
    2 5
    3 9
    4 13
    5 17
    6 21
    7 25
    8 29
    9 33
    10 37
    



    👋

    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: Tabella di verità not(A or B)
    Forum >> Principianti
    o anche




    translate = ["falso", "vero"]
    
    
    def link(a, b):
        return translate[not (a or b)]
    
    
    table = [(False, False), (False, True), (True, False), (True, True)]
    
    for a, b in table:
        print(translate[ a ], translate[ b ], link(a, b))
    
    
    







    --- Ultima modifica di ㎝ in data 2020-08-27 19:16:19 ---
    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: Avviare un programma Python da Phyton su Linux
    Forum >> Principianti
    Ho visto che se faccio un'import del file quando lo dovrei lanciare ... funziona , ma non mi sembra la soluzione migliore.
    Perché?








    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: Problema esecuzione funzione
    Forum >> Principianti
    In pratica lavorando sulla shell, se definisco una funzione e poi provo ad eseguirla invece che svolgere normalmente la funzione mi dice <function f at 0x020F7100>
    Hai dimenticato le parentesi tonde, dopo il nome della funzione. sono obbligatorie, anche se non accetta argomenti.


    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. -- ㎝