{"id":1530,"date":"2021-01-21T13:30:28","date_gmt":"2021-01-21T05:30:28","guid":{"rendered":"http:\/\/cnliutz.uicp.io\/?p=1530"},"modified":"2021-01-21T16:53:19","modified_gmt":"2021-01-21T08:53:19","slug":"python-tkinter","status":"publish","type":"post","link":"http:\/\/g1n29wqq.ipyingshe.net:5347\/?p=1530","title":{"rendered":"Python tkinter"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>from tkinter import *\n#root = Tk()\n\n# Label(root, text=\"Username\").grid(row=0, sticky=W)\n# Label(root, text=\"Passqord\").grid(row=1, sticky=W)\n# Entry(root).grid(row=0, column=1, sticky=E)\n# Entry(root).grid(row=1, column=1, sticky=E)\n# Button(root, text=\"Login\").grid(row=2, column=1,sticky=E)\n# root.mainloop()\n\n# pack using in windows\n# frame = Frame(root)\n# Label(frame, text=\"PACK DEMO of side and fill\").pack()\n# Button(frame, text=\"A\").pack(side=LEFT, fill=Y)\n# Button(frame, text=\"B\").pack(side=TOP, fill=X)\n# Button(frame, text=\"C\").pack(side=RIGHT, fill=NONE)\n# Button(frame, text=\"D\").pack(side=TOP, fill=BOTH)\n# frame.pack()\n# Label(root, text=\"Pack demo of expand\").pack()\n# Button(root, text=\"I do not expand\").pack()\n# Button(root, text=\"I not fill x both I expand\").pack(expand=1)\n# Button(root, text=\"I fill x and expand\").pack(fill=X, expand=1)\n# root.mainloop()\n\n#Find&amp;Replace Dialoge\nparent = Tk()\nparent.title(\"Find &amp; Replace\")\n\nLabel(parent,text=\"Find:\").grid(row=0,column=0,sticky=\"e\")\nEntry(parent,width=60).grid(row=0,column=1,padx=2,pady=2,sticky='we',columnspan=9)\n\nLabel(parent,text=\"Replace:\").grid(row=1,column=0,sticky=\"e\")\nEntry(parent).grid(row=1,column=1,padx=2,pady=2,sticky='we',columnspan=9)\n\nButton(parent,text='Find').grid(row=0,column=10,sticky='e'+'w',padx=2,pady=2)\nButton(parent,text='Find All').grid(row=1,column=10,sticky='e'+'w',padx=2)\nButton(parent,text='Replace').grid(row=2,column=10,sticky='e'+'w',padx=2)\nButton(parent,text='Replace All').grid(row=3,column=10,sticky='e'+'w',padx=2)\n\nCheckbutton(parent,text='Macth all word only').grid(row=2,column=1,columnspan=4,sticky='w')\nCheckbutton(parent,text='Match Case').grid(row=3,column=1,columnspan=4,sticky='w')\nCheckbutton(parent,text='Wrap around').grid(row=4,column=1,columnspan=4,sticky='w')\n\nLabel(parent,text='Direction').grid(row=2,column=6,sticky='w')\nRadiobutton(parent,text='UP',value=1).grid(row=3,column=6,columnspan=6,sticky='w')\nRadiobutton(parent,text='Down',value=1).grid(row=3,column=7,columnspan=6,sticky='w')\nparent.mainloop()\n\n<strong>\u6ce8\u610f<\/strong>\uff1a\u7f16\u7a0b\u73af\u5883\u4f7f\u7528\u4e86 parent.mainloop(),\u7a0b\u5e8f\u624d\u5f00\u59cb\u8fd0\u884c\u3002\n\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"195\" height=\"273\" src=\"http:\/\/cnliutz.uicp.io\/wp-content\/uploads\/2021\/01\/2021-01-21-15-54-50-\u7684\u5c4f\u5e55\u622a\u56fe.png\" alt=\"\" class=\"wp-image-1532\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-1530","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts\/1530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1530"}],"version-history":[{"count":4,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts\/1530\/revisions"}],"predecessor-version":[{"id":1536,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts\/1530\/revisions\/1536"}],"wp:attachment":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1530"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}