Commit cb0eb497 by BellCodeEditor

auto save

parent 49e5a16a
Showing with 33 additions and 22 deletions
# import tkinter
import tkinter
# root = tkinter.Tk()
# root.geometry('300x340+500+200')
# canvas = tkinter.Canvas(root, width=300, height=340, bg="lightblue")
# canvas.place(x=0, y=0)
# # ++++++++++++++++++++++++++++++++++++++++++++++++++++
# def func():
# num = v.get()
# print("你选择了:",num)
root = tkinter.Tk()
root.geometry('300x340+500+200')
canvas = tkinter.Canvas(root, width=300, height=340, bg="lightblue")
canvas.place(x=0, y=0)
# ++++++++++++++++++++++++++++++++++++++++++++++++++++
def func():
num = v.get()
print("你选择了:",num)
# v = tkinter.IntVar()
# rb1 = tkinter.Radiobutton(root,text='体育',value=1,variable=v,command=func)
# rb2 = tkinter.Radiobutton(root,text='美术',value=2,variable=v,command=func)
# rb3 = tkinter.Radiobutton(root,text='音乐',value=3,variable=v,command=func)
# rb4 = tkinter.Radiobutton(root,text='编程',value=4,variable=v,command=func)
# # ++++++++++++++++++++++++++++++++++++++++
# rb1.place(x=50,y=50)
# rb2.place(x=50,y=100)
# rb3.place(x=50,y=150)
# rb4.place(x=50,y=200)
# root.mainloop()\
v = tkinter.IntVar()
f = tkinter.IntVar()
rb1 = tkinter.Radiobutton(root,text='体育',value=1,variable=v,command=func)
rb2 = tkinter.Radiobutton(root,text='美术',value=2,variable=v,command=func)
rb3 = tkinter.Radiobutton(root,text='音乐',value=3,variable=v,command=func)
rb4 = tkinter.Radiobutton(root,text='编程',value=4,variable=v,command=func)
rb5 = tkinter.Radiobutton(root,text='火腿',value=5,variable=v,command=func)
rb6 = tkinter.Radiobutton(root,text='鸡蛋',value=6,variable=v,command=func)
rb7 = tkinter.Radiobutton(root,text='牛奶',value=7,variable=v,command=func)
rb8 = tkinter.Radiobutton(root,text='面包',value=8,variable=v,command=func)
# ++++++++++++++++++++++++++++++++++++++++
rb1.place(x=50,y=50)
rb2.place(x=50,y=100)
rb3.place(x=50,y=150)
rb4.place(x=50,y=200)
rb5.place(x=150,y=50)
rb6.place(x=150,y=100)
rb7.place(x=150,y=150)
rb8.place(x=150,y=200)
root.mainloop()
{"admin": "admin", "python": "123456", "TT": "123", "\u9648TT": {"password": "321", "event": ["\u6211\u662f**", "\u6211\u6c38\u8fdc\u662f**"]}, "\u7a81\u7136": {"password": "321", "event": ["1\uff0c\u4f60\u53ef\u4ee5\u6dfb\u52a0\u4f60\u7684\u4fbf\u7b7e", "2\uff0c\u70b9\u51fb\u4e8b\u4ef6\u524d\u9762\u7684\u5c0f\u65b9\u6846\u53ef\u4ee5\u5b8c\u6210\u4e8b\u4ef6"]}}
\ No newline at end of file
{"admin": "admin", "python": "123456", "TT": "123", "\u9648TT": {"password": "321", "event": ["\u6211\u662f**", "\u6211\u6c38\u8fdc\u662f**"]}, "\u7a81\u7136": {"password": "321", "event": ["1\uff0c\u4f60\u53ef\u4ee5\u6dfb\u52a0\u4f60\u7684\u4fbf\u7b7e", "2\uff0c\u70b9\u51fb\u4e8b\u4ef6\u524d\u9762\u7684\u5c0f\u65b9\u6846\u53ef\u4ee5\u5b8c\u6210\u4e8b\u4ef6"]}, "\u7ed9": {"password": "111", "event": ["1\uff0c\u4f60\u53ef\u4ee5\u6dfb\u52a0\u4f60\u7684\u4fbf\u7b7e", "2\uff0c\u70b9\u51fb\u4e8b\u4ef6\u524d\u9762\u7684\u5c0f\u65b9\u6846\u53ef\u4ee5\u5b8c\u6210\u4e8b\u4ef6"]}}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment