python
#Preparation
root=tk.Tk()
root.geometry("700x700")
root.title("Personality diagnosis of integrity")
#Create a history display text box
rirekibox=tk.Text(root,font=("Helvetica",14))
rirekibox.place(x=0,y=500,width=700,height=400)
python
#label
anounce_labell=tk.Label(root,text="Enter 1 for those that apply, 0 otherwise",font=(20))
anounce_labell.place(x=20,y=20)
qus1_labell = tk.Label(root,text="If anything, it is a person who does it thoroughly.",font=(10))
qus1_labell.place(x=20, y=50)
qus2_labell = tk.Label(root,text="A person who thinks things in a logical way.",font=(10))
qus2_labell.place(x=20, y=80)
qus3_labell = tk.Label(root,text="When traveling, it is often the case that detailed plans are made in advance.",font=(10))
qus3_labell.place(x=20, y=110)
qus4_labell = tk.Label(root,text="Work in the right way with clear goals.",font=(10))
qus4_labell.place(x=20, y=140)
qus5_labell = tk.Label(root,text="I will work hard and study hard.",font=(10))
qus5_labell.place(x=20, y=170)
anounce2_labell=tk.Label(root,text="Enter 1 for those that do not apply, 0 otherwise",font=(20))
anounce2_labell.place(x=20,y=210)
qus6_labell = tk.Label(root,text="He is rather lazy.",font=(10))
qus6_labell.place(x=20, y=240)
qus7_labell = tk.Label(root,text="Even if you work on something, you often stop halfway.",font=(10))
qus7_labell.place(x=20, y=270)
qus8_labell = tk.Label(root,text="If anything, he is a three-day priest and has no patience.",font=(10))
qus8_labell.place(x=20, y=300)
qus9_labell = tk.Label(root,text="I'm rather tired of it.",font=(10))
qus9_labell.place(x=20, y=330)
qus10_labell = tk.Label(root,text="Often, the problem is not considered in detail and is put into practice.",font=(10))
qus10_labell.place(x=20, y=360)
qus11_labell = tk.Label(root,text="You make decisions and act carelessly.",font=(10))
qus11_labell.place(x=20, y=390)
qus12_labell = tk.Label(root,text="If things go wrong, you'll want to throw it out right away.",font=(10))
qus12_labell.place(x=20, y=420)
python
#Text box
editbox1 = tk.Entry(width=2)
editbox1.place(x=380, y=55)
editbox2 = tk.Entry(width=2)
editbox2.place(x=340, y=85)
editbox3 = tk.Entry(width=2)
editbox3.place(x=550, y=115)
editbox4 = tk.Entry(width=2)
editbox4.place(x=580, y=145)
editbox5 = tk.Entry(width=2)
editbox5.place(x=400, y=175)
editbox6 = tk.Entry(width=2)
editbox6.place(x=320, y=245)
editbox7 = tk.Entry(width=2)
editbox7.place(x=560, y=275)
editbox8 = tk.Entry(width=2)
editbox8.place(x=480, y=305)
editbox9 = tk.Entry(width=2)
editbox9.place(x=350, y=335)
editbox10 = tk.Entry(width=2)
editbox10.place(x=510, y=365)
editbox11 = tk.Entry(width=2)
editbox11.place(x=450, y=395)
editbox12 = tk.Entry(width=2)
editbox12.place(x=520, y=425)
--Since it is necessary to place it together with the label, repeat trial and error.
python
def ButtonClick():
q1=int(editbox1.get())
q2=int(editbox2.get())
q3=int(editbox3.get())
q4=int(editbox4.get())
q5=int(editbox5.get())
q6=int(editbox6.get())
q7=int(editbox7.get())
q8=int(editbox8.get())
q9=int(editbox9.get())
q10=int(editbox10.get())
q11=int(editbox11.get())
q12=int(editbox12.get())
result=q1+q2+q2+q3+q4+q5+q6+q7+q8+q9+q10+q11+q12
rirekibox.insert(tk.END,"total:"+str(result)+"\n")
if result<=1:
rirekibox.insert(tk.END,"Diagnosis:Conscientiousness is weak\n"+"We will work vigorously and thoroughly on everything and make detailed plans. Responsible, hardworking, careful and practical. Therefore, a given job is done quickly and accurately. A well-mannered, conscientious, disciplined frugalist. It's time-accurate, which makes it difficult for others to feel.")
if result>=2 and result<=4:
rirekibox.insert(tk.END,"Diagnosis:Fairly weak integrity\n"+"They are lazy, have no patience, and tend to stop doing everything halfway. It's not responsible, it's capricious, it's sloppy, and it's boring. You can be vague and carelessly decide or act.")
if result>=5 and result<=8:
rirekibox.insert(tk.END,"Diagnosis:About halfway to the whole\n"+"I'm not a person who is particularly energetic and thorough in my work and study, but I do what I should do on a par with people. He is not the one who does it especially quickly, efficiently and accurately. Attentiveness and practical sensations are standard. I also keep a lot of time and be careful not to be sloppy and accurate.")
if result>=9 and result<=11:
rirekibox.insert(tk.END,"Diagnosis:Fairly strong integrity\n"+"He is a person who works vigorously and thoroughly on everything and makes detailed plans. Responsible, hardworking, careful and practical. Therefore, a given job will try to get it done quickly and accurately. A well-mannered and conscientious frugalist. The person who is accurate in time.")
if result==12:
rirekibox.insert(tk.END,"Diagnosis:A person with strong integrity\n"+"We will work vigorously and thoroughly on everything and make detailed plans. Responsible, hardworking, careful and practical. Therefore, a given job is done quickly and accurately. A well-mannered, conscientious, disciplined frugalist. It's time-accurate, which makes it difficult for others to feel.")
――It took me a long time to forget that I had to separate the strings and numbers when I got the total score ...
python
coding-utf-8
import tkinter as tk
import tkinter.messagebox as tmsg
def ButtonClick():
q1=int(editbox1.get())
q2=int(editbox2.get())
q3=int(editbox3.get())
q4=int(editbox4.get())
q5=int(editbox5.get())
q6=int(editbox6.get())
q7=int(editbox7.get())
q8=int(editbox8.get())
q9=int(editbox9.get())
q10=int(editbox10.get())
q11=int(editbox11.get())
q12=int(editbox12.get())
result=q1+q2+q2+q3+q4+q5+q6+q7+q8+q9+q10+q11+q12
rirekibox.insert(tk.END,"total:"+str(result)+"\n")
if result<=1:
rirekibox.insert(tk.END,"Diagnosis:Conscientiousness is weak\n"+"We will work vigorously and thoroughly on everything and make detailed plans. Responsible, hardworking, careful and practical. Therefore, a given job is done quickly and accurately. A well-mannered, conscientious, disciplined frugalist. It's time-accurate, which makes it difficult for others to feel.")
if result>=2 and result<=4:
rirekibox.insert(tk.END,"Diagnosis:Fairly weak integrity\n"+"They are lazy, have no patience, and tend to stop doing everything halfway. It's not responsible, it's capricious, it's sloppy, and it's boring. You can be vague and carelessly decide or act.")
if result>=5 and result<=8:
rirekibox.insert(tk.END,"Diagnosis:About halfway to the whole\n"+"I'm not a person who is particularly energetic and thorough in my work and study, but I do what I should do on a par with people. He is not the one who does it especially quickly, efficiently and accurately. Attentiveness and practical sensations are standard. I also keep a lot of time and be careful not to be sloppy and accurate.")
if result>=9 and result<=11:
rirekibox.insert(tk.END,"Diagnosis:Fairly strong integrity\n"+"He is a person who works vigorously and thoroughly on everything and makes detailed plans. Responsible, hardworking, careful and practical. Therefore, a given job will try to get it done quickly and accurately. A well-mannered and conscientious frugalist. The person who is accurate in time.")
if result==12:
rirekibox.insert(tk.END,"Diagnosis:A person with strong integrity\n"+"We will work vigorously and thoroughly on everything and make detailed plans. Responsible, hardworking, careful and practical. Therefore, a given job is done quickly and accurately. A well-mannered, conscientious, disciplined frugalist. It's time-accurate, which makes it difficult for others to feel.")
#Preparation
root=tk.Tk()
root.geometry("700x700")
root.title("Personality diagnosis of integrity")
#Create a history display text box
rirekibox=tk.Text(root,font=("Helvetica",14))
rirekibox.place(x=0,y=500,width=700,height=400)
#label
anounce_labell=tk.Label(root,text="Enter 1 for those that apply, 0 otherwise",font=(20))
anounce_labell.place(x=20,y=20)
qus1_labell = tk.Label(root,text="If anything, it is a person who does it thoroughly.",font=(10))
qus1_labell.place(x=20, y=50)
qus2_labell = tk.Label(root,text="A person who thinks things in a logical way.",font=(10))
qus2_labell.place(x=20, y=80)
qus3_labell = tk.Label(root,text="When traveling, it is often the case that detailed plans are made in advance.",font=(10))
qus3_labell.place(x=20, y=110)
qus4_labell = tk.Label(root,text="Work in the right way with clear goals.",font=(10))
qus4_labell.place(x=20, y=140)
qus5_labell = tk.Label(root,text="I will work hard and study hard.",font=(10))
qus5_labell.place(x=20, y=170)
anounce2_labell=tk.Label(root,text="Enter 1 for those that do not apply, 0 otherwise",font=(20))
anounce2_labell.place(x=20,y=210)
qus6_labell = tk.Label(root,text="He is rather lazy.",font=(10))
qus6_labell.place(x=20, y=240)
qus7_labell = tk.Label(root,text="Even if you work on something, you often stop halfway.",font=(10))
qus7_labell.place(x=20, y=270)
qus8_labell = tk.Label(root,text="If anything, he is a three-day priest and has no patience.",font=(10))
qus8_labell.place(x=20, y=300)
qus9_labell = tk.Label(root,text="I'm rather tired of it.",font=(10))
qus9_labell.place(x=20, y=330)
qus10_labell = tk.Label(root,text="Often, the problem is not considered in detail and is put into practice.",font=(10))
qus10_labell.place(x=20, y=360)
qus11_labell = tk.Label(root,text="You make decisions and act carelessly.",font=(10))
qus11_labell.place(x=20, y=390)
qus12_labell = tk.Label(root,text="If things go wrong, you'll want to throw it out right away.",font=(10))
qus12_labell.place(x=20, y=420)
#Text box
editbox1 = tk.Entry(width=2)
editbox1.place(x=380, y=55)
editbox2 = tk.Entry(width=2)
editbox2.place(x=340, y=85)
editbox3 = tk.Entry(width=2)
editbox3.place(x=550, y=115)
editbox4 = tk.Entry(width=2)
editbox4.place(x=580, y=145)
editbox5 = tk.Entry(width=2)
editbox5.place(x=400, y=175)
editbox6 = tk.Entry(width=2)
editbox6.place(x=320, y=245)
editbox7 = tk.Entry(width=2)
editbox7.place(x=560, y=275)
editbox8 = tk.Entry(width=2)
editbox8.place(x=480, y=305)
editbox9 = tk.Entry(width=2)
editbox9.place(x=350, y=335)
editbox10 = tk.Entry(width=2)
editbox10.place(x=510, y=365)
editbox11 = tk.Entry(width=2)
editbox11.place(x=450, y=395)
editbox12 = tk.Entry(width=2)
editbox12.place(x=520, y=425)
#button
button1 = tk.Button(root, text="Check", font=("Helvetica"),command=ButtonClick)
#command is the function to execute when clicked
button1.place(x=600, y=400)
#window display
root.mainloop()
――I was really worried about what to make and tried various things, but I could make images, but I couldn't make most of them. ――I want to be able to make everything I imagined.
-Psychological test ―― "The easiest Python introductory class" Fumitaka Osawa [Author]
Recommended Posts