|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
内容:
- from tkinter import *
- #python3.8.1
- class GO_TYPE:
- putager = 0
- tget = 1
- tput = 2
- shget = 3
- shput = 4
- class TES:
- def main():
- tes = TES()
- cp = None
- bpanel = None
- cancel = None
- blabel = None
- step = GO_TYPE.putager
- def __init__(self):
- self.root = Tk()
- self.root.title("虎吃羊")
- self.frame = Frame(self.root, width=1200, height=600)
- self.frame.grid(row=0,column=0)
- TES.bpanel = Frame(self.frame, width=600, height=600)
- TES.cancel = Button(TES.bpanel, text="撤销操作", command=self.eventdown)
- TES.bpanel.place(relx=0.75, rely=0.5, anchor=CENTER, relheight=1.0, relwidth=0.5)
- TES.cancel.grid(row=0,column=0,rowspan=10)
-
- cp = CheckPanel()
- class CheckPanel:
- pass
- def eventdown(self):
- if step == GO_TYPE.tput:
- step = GO_TYPE.tget
- print("撤销成功,您又可以拿起您的大老虎啦")
- elif step == GO_TYPE.shput:
- step = GO_TYPE.shget
- print("撤销成功,您又可以拿起您的小绵羊啦")
- TES.main()
复制代码
打开时:
---------------------------
|请确认使用什么编码:|
[utf-8_____________ ]
[_____[确认]_______|
然后:
_________________________
[编码错误: ]
[无法使用 utf-8 编码打开此文件]
[_____[确认]______________ ]
我自己写的记事本和电脑自带的记事本都能打开.....
因为中文版的Windows系统使用的默认编码是gbk编码,而Python3使用的是utf-8编码,所以,当你用IDLE打开用Windows记事本编辑的文件时,就会出现编码错误
|
|