#coding: utf-8
from Tkinter import *
jisuanwanbiqingkonggongshi=FALSE
print('欢迎使用一颗痛苦python的计算器！'); Fafsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfs = '' #|
top = Tk(); TheFirstHAfhascnaAIaghahHTlLabel= Label(top, text= '这里是输出流。') #\
class BUNCAHSDF(object):
 def __init__(self): None; self.Fafsfsfsfsfsfsfsfsfsfs = ''; global TheFirstHAfhascnaAIaghahHTlLabel
 def write(self, text):
   self.Fafsfsfsfsfsfsfsfsfsfs = self.Fafsfsfsfsfsfsfsfsfsfs + text
   TheFirstHAfhascnaAIaghahHTlLabel.configure(text   = self.Fafsfsfsfsfsfsfsfsfsfs)
   global top; top.title(self.Fafsfsfsfsfsfsfsfsfsfs)
 def flush(self): import sys; sys.stderr.flush(); TheFirstHAfhascnaAIaghahHTlLabel.configure(text=''); self.Fafsfsfsfsfsfsfsfsfsfs = ''
yunsuangongshi=''
def plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang(jiadeshishenme_haorangwozhidaoyixiayebucuo):
    global yunsuangongshi
    for xunhuan in range(0,10,1):global yunsuangongshi
    if jisuanwanbiqingkonggongshi == TRUE:
        if jiadeshishenme_haorangwozhidaoyixiayebucuo=='1':
            yunsuangongshi= ''
            jisuanwanbiqingkonggongshi = FALSE
            print('公式已经清空啦。你可以再次计算了。')
        elif jiadeshishenme_haorangwozhidaoyixiayebucuo== '2':
            jisuanwanbiqingkonggongshi = FALSE; print('好吧那就算了')
        else: print('选项未知。请选多次。')
    elif jisuanwanbiqingkonggongshi==FALSE:
        global yunsuangongshi; yunsuangongshi+=jiadeshishenme_haorangwozhidaoyixiayebucuo; print(yunsuangongshi)
        global jisuanwanbiqingkonggongshi;
def dangzheweirenxionganxialedengyuhaodeshihoujiujinghuifashengxieshenme(wozhishilaikankanzhegebianliangdemingzidaodigaishishenmehao):
            global yunsuangongshi;
            global jisuanwanbiqingkonggongshi
            if '/' in yunsuangongshi: yunsuangongshi = yunsuangongshi+'.0'
            try: exec('jieguo= ' +yunsuangongshi); True
            except: print('标准输出流错误。你的公式或许有问题。'); jk = False
            try:
                if jk is False: print('没有结果。')
            except: print(jieguo)
            print('计算完毕。清空公式吗？ 1确定，2取消。')
            jisuanwanbiqingkonggongshi= TRUE
def cleargongshiforfundanshiniyongyuanyebuhuizhidaoweishenmetazhemehaowanzhegejiangchengweipythonshishangzuichangdedefdemingzidanshitashikeyiyunxingdezhiyaonizugoudantengtahuirangnigengdantengmwahahahahahahawoshiyiketongkudepythonwoweizijidaiyan():global yunsuangongshi; yunsuangongshi=''; print('运算公式已经清空，祝你使用愉快')
TheSeconONeIWIlklKillYouInoneHhiotasfsaf = Button(top, text ='1',command=lambda :plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('1')) #Lahlahlahlahlah
Theasdncnascnavnv = Button (top, text  = '2',command=lambda :plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('2'));yunsuangongshi=''
import sys
sys.stdout = BUNCAHSDF()
THasfnacv = Button  (top, text=      '3', command=lambda :plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('3')) ;snvvvvvvv = Button(top, text  =                '6',command=lambda :plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('6'))#♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔♔
THascacsvvvv = Button(top, text='4',command=lambda :plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('4'));None;Thavcnvvvvvvvvvv = Button(top,   text    =         '5',command=lambda :plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('5'));True
asdvnvavsaw = Button(top, text  = '7',command=lambda :plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('7')); asfhvvvvv = Button(top, text ='8',command=lambda :plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('8'));None;
avbbbbbbb=Button(top, text= '9',command = lambda :plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('9')); equaaslfasv            = Button(top, text=   '=',command=lambda :dangzheweirenxionganxialedengyuhaodeshihoujiujinghuifashengxieshenme('Fuck'))
[True, True, True, True, True, True, True, True]             ;[False];
ascbnascasfr =   Button(top, text = '*', command = lambda:plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('*')); awdwwdwd = Button(top, text= '/',command=lambda:plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('/'));
TheFirstHAfhascnaAIaghahHTlLabel.pack();TheSeconONeIWIlklKillYouInoneHhiotasfsaf.pack();Theasdncnascnavnv.pack();True;
THasfnacv.pack();THascacsvvvv.pack();   Thavcnvvvvvvvvvv.pack();snvvvvvvv.pack();asdvnvavsaw.pack();[False, True];
asfhvvvvv.pack();avbbbbbbb.pack();equaaslfasv.pack();          ascbnascasfr.pack();awdwwdwd.pack()
geijiankangzuodaojiafa= Button(top, text= '+', command= lambda :plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('+'));True;geijiankangzuodaojiafa.pack()
geiyouhaidedupinzuodaojianfa=       Button(top, text= '-',command= lambda :plusinyunsuangongshi_geiyunsuangongshizuodaojiafa_xixigengjiankang('-'));geiyouhaidedupinzuodaojianfa.pack()
qingkongzhegejisuandeshuzu = Button(top, text = '清空公式',command=cleargongshiforfundanshiniyongyuanyebuhuizhidaoweishenmetazhemehaowanzhegejiangchengweipythonshishangzuichangdedefdemingzidanshitashikeyiyunxingdezhiyaonizugoudantengtahuirangnigengdantengmwahahahahahahawoshiyiketongkudepythonwoweizijidaiyan)
qingkong = Button(top, text = '点我，清空标准输出流', command=sys.stdout.flush);None;None;None;qingkong.pack();True;qingkongzhegejisuandeshuzu.pack()
mainloop()