[Python] Como guardar valores de variáveis em: Entry? [fechada]

Discussão em 'Python' iniciado por Stack, Outubro 20, 2024.

  1. Stack

    Stack Membro Participativo

    main.py

    # Projeto B3 Investimentos

    import tkinter as tk
    from tkinter import ttk

    # Criar função soma

    def soma(a??, b??):
    x = a?? + b??
    return x

    resultado = soma(a??, b??)

    # Criar função Salvar
    # SALVAR EM b3invest.xlsx ???

    def salvar(???):
    ??
    ??

    # Criar janela

    root = tk.Tk()
    root.title("B3 INVESTIMENTOS")
    root.geometry("400x300")

    # Criar Label e Entry

    lbl_ticker1 = ttk.Label(root, texto="Ticker:", fonte=("Arial 10")
    lbl_ticker1.grid(row=1, column=0, padx=10, pady=10, sticky = "e")
    entry_div1 = ttk.Entry(root, width=8)
    entry_div1.grid(row=1, column=1, padx=10, pady=10)

    lbl_ticker2 = ttk.Label(root, texto="Ticker:", fonte=("Arial 10")
    lbl_ticker2.grid(row=2, column=0, padx=10, pady = 10, sticky = "e")
    entry_div1 = ttk.Entry(root, width=8)
    entry_div1.grid(row=2, column=1, padx=10, pady=10)
    entry_div2 = ttk.Entry(root, width=8)

    # Criar Button Somar

    btn_somar = ttk.Button(root, text= "Somar", width=8, command = somar)
    btn_somar.grid(row = 4, column = 1)

    # Criar Button Salvar

    btn_salvar = ttk.Button(root, text= "Salvar", width=8, command = salvar)
    btn_salvar.grid(row = 4, column = 0)

    # Criar Loop

    root.mainloop()

    Continue reading...

Compartilhe esta Página