всем, у меня проблемы с извлечением данных из всех моих записей, когда я пытаюсь запустить программу, которая запускается, но не дает мне информацию, которая мне необходима для фактической работы.
У меня проблемы может быть в методе get () tkinter или есть идея, где проблема в коде? Я на самом деле новичок в этом, у меня как месяц сейчас программирование.
#Importing all files
from tkinter import *
import tkinter as tk
import os
#The command we will use to close the window
def destroy():
top.destroy()
#This is the text we want to display
def texto():
greets = ("Welcome " + str(Name) + "\n ")
contact1 = ("We will contact you to " + str(Email) + "\n ")
contact2 = ("If not possible to reach you, we will try with your phone number: " + str(Phone) + "\n ")
contact3 = ("Your desired salary: " + str(Salary) + " will be taken in count \n ")
contact4 = ("This information will be linked to your ID: " + str(ID) + " in our system \n ")
return greets, contact1, contact2, contact3, contact4
#Function created to active the text once the information is filled
def activar():
#Displaying the text in another window
window = tk.Tk()
window.title("Application submitted")
Result = tk.Label(window, text = texto)
Result.pack()
#Creating the window
top = tk.Tk()
#Size of the window
top.geometry("400x300")
#Title of the previous window
top.title("Application form")
#Labels of the window
greeting = tk.Label(top, text = "Please enter the information asked for below"). place(x =30,y = 10)
name = tk.Label(top, text = "Name").place(x = 30,y = 50)
email = tk.Label(top, text = "Email").place(x = 30, y = 90)
phone_number = tk.Label(top, text = "Phone Number").place(x = 30, y = 130)
salary = tk.Label(top, text = "Expected salary").place(x = 30, y = 170)
identification = tk.Label(top, text= "National certified ID").place(x = 30,y = 210)
#Botton of the window
submit = tk.Button(top, text = "Submit",activebackground = "pink", activeforeground = "blue", command= activar).place(x = 320, y = 250)
#Entries
e1 = tk.Entry(top)
e1.place(x = 80, y = 50)
e2 = tk.Entry(top)
e2.place(x = 80, y = 90)
e3 = tk.Entry(top)
e3.place(x = 120, y = 130)
e4 = tk.Entry(top)
e4.place(x = 120, y = 170)
e5 = tk.Entry(top)
e5.place(x = 160, y = 210)
#Getting the information of each entry
Name = e1.get()
Email = e2.get()
Phone = e3.get()
Salary = e4.get()
ID = e5.get()
#Executing the window
top.mainloop()