Profilo di Gabbo

Nome Gabbo
Indirizzo email n/a
Messaggi5
  • Re: problema a posizionare un controllo slider
    Forum >> Programmazione Python >> GUI
    Io uso il comando:




    w.place(x = 65 , y = 325 )




    x e y si rifriscono a pixel, quinidi puoi posizionare label o testo in quasiasi posizione della finestra.






  • Re: Problema con Tkinter()
    Forum >> Programmazione Python >> GUI
    Hai provato ad installare tkinter??




    linux


    sudo apt-get install python3-tk




    win

    pip install tk






  • Tkinter etichette con font e dimensioni diverse avvicinate
    Forum >> Programmazione Python >> GUI
    Buongiorno,

    Vorrei eseguire una visualizzazione di una sonda temperatura




    T 52,10 °C




    T = font arial size 20


    52 = font DSEG14 Classic size 20


    10 = font DSEG14 Classic size 12



    °C = font arial size 20


    in calce soluzione che ho identificato, ma quando sposto la posizione o il font in fse di programmazione devo


    modificare le coocrdinate.

    Non riesco a unire il tutto.

    cete una soluzione alternativa e più comoda??




    Grazie





    VFont = "DSEG14 Classic"
    VSize = 20




    ta = sonda.temp2()
    ############################
    ta1 = f"{ta:.2f}" #ricavo due decimali anche se il valore è 0

    ta2 = len(ta1) # lunghezza caratteri variabile ta2 es. (30,40) 5 caratteri




    if ta2 == 5:
    dec_ta = ta1[3:5] #recupero decimali se < 100
    int_ta = ta1[0:3] #recupero intero se < 100
    else:
    dec_ta = ta1[4:6] #recupero decimali se > 100
    int_ta = ta1[0:4] #recupero intero se < 100

    ta_0 = ("T ")
    ta_1 = str(int_ta) # Temperatura prima della virgola
    ta_2 = (str(dec_ta)) # Temperatura dopo la virgola
    ta_3 = (str(chr(176))+"C") # chr(176) serve per simbolo gradi


    Vfg_lab = "blue"

    Tsonda1_labe0 = tk.Label(fin, font=("Arial",VSize),fg=Vfg_lab , bg='#FF8700')
    Tsonda1_labe1 = tk.Label(fin, font=(VFont,VSize), fg=Vfg_lab , bg='#FF8700')
    Tsonda1_labe2 = tk.Label(fin, font=(VFont,12), fg=Vfg_lab , bg='#FF8700')
    Tsonda1_labe3 = tk.Label(fin, font=("Arial", VSize),fg=Vfg_lab , bg='#FF8700')


    x_p = 180 # posizione x
    xvv = 20 # variabile per spostare le altre etichette




    Tsonda1_labe0.configure(text = ta_0)
    Tsonda1_labe1.configure(text = ta_1)
    Tsonda1_labe2.configure(text = ta_2)
    Tsonda1_labe3.configure(text = ta_3)

    Tsonda1_labe0.place(x = x_p , y = 450)# T
    x_p = x_p + xvv
    Tsonda1_labe1.place(x = x_p + 4 , y = 450)# Temperatura prima della virgola
    x_p = x_p + (xvv * 2)
    Tsonda1_labe2.place(x = x_p + 10 , y = 460)# Temperatura dopo la virgola
    x_p = x_p + (xvv * 2)
    Tsonda1_labe3.place(x = x_p , y = 450)# C


  • aiuto pip raspberry Pi 3
    Forum >> Programmazione Python >> GUI
    Chiedo aiuto,

    Non riesco più ad installare la libreria matplotlib per python 3.10

    invio il resoconto del terminal...




    Grazie





    pi@raspberrypi:~ $ pip install matplotlib
    Defaulting to user installation because normal site-packages is not writeable
    WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/matplotlib/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/matplotlib/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/matplotlib/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/matplotlib/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/matplotlib/
    Could not fetch URL https://pypi.org/simple/matplotlib/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/matplotlib/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/matplotlib/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/matplotlib/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/matplotlib/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/matplotlib/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/matplotlib/
    Could not fetch URL https://www.piwheels.org/simple/matplotlib/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='www.piwheels.org', port=443): Max retries exceeded with url: /simple/matplotlib/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
    ERROR: Could not find a version that satisfies the requirement matplotlib (from versions: none)
    ERROR: No matching distribution found for matplotlib

  • Problema Raspberry PI con NavigationToolbar2Tk
    Forum >> Programmazione Python >> GUI
    Buongiorno,

    Sono alle prime armi con Python, volevo provare un semplice programma che ho trovato in rete, per verificare le potenzialità di matplotlib

    su Raspberry PI 3 purtroppo quando vado in esecuzione il l'IDE mi da il seguente errore:




    Python 3.5.3 (default, Nov 4 2021, 15:29:10)
    [GCC 6.3.0 20170516] on linux
    Type "copyright", "credits" or "license()" for more information.
    >>>
    ===================== RESTART: /home/pi/Desktop/prova.py =====================
    Traceback (most recent call last):
    File "/home/pi/Desktop/prova.py", line 11, in <module>
    from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
    ImportError: cannot import name 'NavigationToolbar2Tk'
    >>>






    non riesce ad importare NavigationToolbar2Tk




    su windows funziona ma su raspberry no

    qualcuno sa darmi una spiegazione??




    Grazie





    allego sorgente:






    --- Ultima modifica di Gabbo in data 2022-04-30 10:11:14 ---