iT邦幫忙

0

請問我要怎麼顯示出來我的tkinter(試了好久都出不來...

  • 分享至 

  • xImage

'''
import tkinter as tk

def button_event():
choice=int(en_1.get())
x1=int(en_2.get())
x2=int(en_3.get())
sigmax1=int(en_4.get())
sigmax2=int(en_5.get())
n1=int(en_6.get())
n2=int(en_7.get())

while True:
    choice = input("Enter choice(1/2/3/4/5): ")

    if choice in ('1', '2', '3', '4','5'):

        if choice == '1':
            print('Z value is',(x1-x2)/(((((sigmax1)**2)/n1)+(((sigmax2)**2)/n2))**(1/2)))

        elif choice == '2':
            print('Pooled sample variance',((n1-1)*((sigmax1)**2)+(n2-1)*((sigmax2)**2))/(n1+n2-2))

        elif choice == '3':
            print('T value for unknown sigma is',(x1-x2)/(((n1-1)*((sigmax1)**2)+(n2-1)*((sigmax2)**2))/((n1+n2-2))*((1/n1)+(1/n2))))
        
        elif choice == '4':
            print('DF for unequal variance is',((((sigmax1)**2/(n1))+((sigmax2)**2/(n2)))**2)/(((((sigmax1)**2/(n1))**2)/(n1-1))+((((sigmax2)**2/(n2))**2)/(n2-1))))
            
        elif choice == '5':
            print('T value for unequal variance is',(x1-x2)/(((((sigmax1)**2)/n1)+(((sigmax2)**2)/n2))**(1/2)))
        
        next_calculation = input("Let's do next calculation? (yes/no): ")
        if next_calculation == "no":
          break
    else:
        print("Invalid Input")
        

window=tk.Tk()
window.title('Statistic calculatar')
window.geometry('600x600')

La_1=tk.Label(window,text='Aws:')
La_1.place(x=200,y=500)

La_2=tk.Label(window,text='Welcome to statistic calculator')
La_2.place(x=200,y=50)

bu_1=tk.Button(window,text='Let us enter the stastistic world!',command=button_event)
bu_1.place(x=200,y=100)

en_1=tk.Entry()
en_1.place(x=200,y=150)

en_2=tk.Entry()
en_2.place(x=200,y=200)

en_3=tk.Entry()
en_3.place(x=200,y=250)

en_4=tk.Entry()
en_4.place(x=200,y=300)
en_5=tk.Entry()
en_5.place(x=200,y=350)

en_6=tk.Entry()
en_6.place(x=200,y=400)

en_7=tk.Entry()
en_7.place(x=200,y=450)

window.mainloop()
'''

先學會貼程式碼,跟學會問問題的學問。
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0

我要發表回答

立即登入回答