{"id":311,"date":"2018-06-30T08:35:29","date_gmt":"2018-06-30T06:35:29","guid":{"rendered":"http:\/\/pythonprogramming.altervista.org\/?p=311"},"modified":"2020-01-05T05:20:40","modified_gmt":"2020-01-05T04:20:40","slug":"tkinter-9-entry-widget","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/tkinter-9-entry-widget\/","title":{"rendered":"Tkinter 9: Entry widget"},"content":{"rendered":"<p>In this new post about <strong>tkinter<\/strong>, the <b>module<\/b> to create a <b>GUI<\/b> for python programming language: let&#8217;s see how to use the following three <b>widgets<\/b> with the tkinter module:<\/p>\n<ul>\n<li><strong>Entry<\/strong> widget<\/li>\n<li><strong>Label<\/strong> widget<\/li>\n<li><strong>Listbox<\/strong> widget<\/li>\n<\/ul>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/11\/tkinter_entry_shuffler.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4171 size-full\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/11\/tkinter_entry_shuffler.png\" alt=\"Example of a window made with tkinter with an entry and a text widget\" width=\"1045\" height=\"613\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/11\/tkinter_entry_shuffler.png 1045w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/11\/tkinter_entry_shuffler-320x188.png 320w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/11\/tkinter_entry_shuffler-768x451.png 768w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/11\/tkinter_entry_shuffler-960x563.png 960w\" sizes=\"auto, (max-width: 1045px) 100vw, 1045px\" \/><\/a><\/p>\n<h2>An example, to start<\/h2>\n<p>In the following code we can see a little GUI to insert text in an entry, copy it into a label and a listbox at the same time.<\/p>\n<h2>Get the text in the entry widget<\/h2>\n<p>The entry widget is a <strong>texbox<\/strong> that can be used to get the <strong>input<\/strong> of the user. We need to get the vale that the user enters in the entry widget then. To get the text in the entry widget you need to follow this scheme:<\/p>\n<ul>\n<li>create a StringVar() object\n<ul>\n<li><strong>textvar = tkinter.Stringvar()<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>link it to the entry with the argument\n<ul>\n<li><strong>e = Entry(root, textvariable=textvar)<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>when the user hit return the function pass_value is called:<\/li>\n<li><strong>entry.bind(&#8220;&lt;Return&gt;&#8221;, lambda x: pass_value()) <\/strong><\/li>\n<\/ul>\n<p>The pass_value function gets the value of the texvar istance of StringVar with the method get:<\/p>\n<ul>\n<li><strong>label[&#8220;text&#8221;] = textvar.get()<\/strong><\/li>\n<li><strong>listbox.insert(&#8220;1.0&#8221;, textvar.get())<\/strong><\/li>\n<\/ul>\n<p>So, this is the scheme to remember:<\/p>\n<table class=\"table1\" style=\"height: 78px;\" border=\"1\" width=\"446\">\n<tbody>\n<tr>\n<td style=\"text-align: center;\" colspan=\"3\"><strong>Scheme<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">global scope<\/td>\n<td style=\"text-align: center;\" align=\"right\">\u00a0 \u00a0 \u00a0 entry argument<\/td>\n<td style=\"text-align: center;\" align=\"right\">\u00a0how to get it<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\"><strong>v = tkinter.StringVar<\/strong><\/td>\n<td style=\"text-align: center;\" align=\"right\"><strong>\u00a0textvariable=v<\/strong><\/td>\n<td style=\"text-align: center;\" align=\"right\"><strong>\u00a0 \u00a0 v.get()<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>What is StringVar<\/h2>\n<p>Tkinter uses Tcl to use the widgets like labels, buttons etc.<br \/>\nTo trace some values like the text in an entry widget, you can use a Tkinter variable with its constructor in this way:<\/p>\n<p><strong>var = StringVar()<\/strong><\/p>\n<p>It takes no value argument. To give it to it you can call the set method:<\/p>\n<p>var.set(&#8220;hello&#8221;)<\/p>\n<p>You can use this code to track the changes in the content of the widget that uses this var<\/p>\n<pre class=\"lang:default decode:true\">def callback(*args):\r\nimport tkinter as tk\r\ndef callback(*args):\r\n    print(\"Value changed\")\r\n\r\nroot = tk.Tk()\r\nvar = tk.StringVar()\r\nvar.trace(\"w\", callback)\r\n\r\nentry = tk.Entry(root, textvariable=var)\r\nentry.pack()\r\n\r\nroot.mainloop()<\/pre>\n<p>Let&#8217;s see the output of the code in this video.<\/p>\n<div style=\"width: 747px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-311-1\" width=\"747\" height=\"420\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/06\/tracingTk.mp4?_=1\" \/><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/06\/tracingTk.mp4\">https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/06\/tracingTk.mp4<\/a><\/video><\/div>\n<h3>Updating the value with callback function and trace method<\/h3>\n<p>We can use the trace method to do something useful like updating the value passed to a label, for example:<\/p>\n<pre class=\"lang:default decode:true \">import tkinter as tk\r\ndef callback(*args):\r\n    print(\"Value changed\")\r\n    label['text'] = entry.get()\r\n\r\n\r\n\r\nroot = tk.Tk()\r\nvar = tk.StringVar()\r\nvar.trace(\"w\", callback)\r\n\r\nentry = tk.Entry(root, textvariable=var)\r\nentry.pack()\r\n\r\nlabel = tk.Label(root)\r\nlabel.pack()\r\n\r\nroot.mainloop()<\/pre>\n<div style=\"width: 747px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-311-2\" width=\"747\" height=\"420\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/06\/trace2.mp4?_=2\" \/><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/06\/trace2.mp4\">https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/06\/trace2.mp4<\/a><\/video><\/div>\n<h2>The example<\/h2>\n<p>In the following example we build a simple GUI with some widgets among wich we have the entry object with the StringVar() class taking trace of the value of the entry.<\/p>\n<pre class=\"lang:default decode:true\">\"\"\"GUI example with entry\r\n\r\nA window with chance to put text into a label and a listbox\r\n\"\"\"\r\n\r\n# IMPORTING THE MODULE TKINTER\r\nimport tkinter\r\n\r\n# THE WINDOW INSTANCE\r\nroot = tkinter.Tk()\r\n\r\n# WIDTH AND HEIGHT + X AND Y OF THE SCREEN\r\nroot.geometry(\"400x400+400+400\")\r\n\r\n\r\ndef pass_value():\r\n    \"\"\"Passes the value into the label and the listbox\"\"\"\r\n\r\n    # TAKES THE TEXT IN THE ENTRY (that hase the textvariable = textvar)\r\n    label['text'] = textvar.get()\r\n\r\n    # AND INSERT THAT TEXT INTO THE LB\r\n    listbox.insert(tkinter.END, textvar.get())\r\n\r\n    # Delete the entry text\r\n    textvar.set(\"\")\r\n\r\ntextvar = tkinter.StringVar()\r\ndef entry():\r\n\t\"\"\"Creates an entry, a label and a listbox\"\"\"\r\n\tentry = tkinter.Entry(root, textvariable=textvar)\r\n\tentry['font'] = \"Arial 28\"\r\n\tentry.focus()\r\n\tentry.pack()\r\n\tentry.bind(\"&lt;Return&gt;\", lambda x: pass_value())\r\n\tlabel = tkinter.Label(root)\r\n\tlabel.pack()\r\n\tlistbox = tkinter.Listbox(root)\r\n\tlistbox.pack()\r\n\treturn entry, label, listbox\r\n\r\nentry, label, listbox = entry()\r\n\r\nroot.mainloop()<\/pre>\n<h2>Get what the user inputs<\/h2>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/tkinter-9-entry-widget\/tk9\/\" rel=\"attachment wp-att-312\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-312\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/06\/tk9.png\" alt=\"tkinter entry widgets\" width=\"337\" height=\"222\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/06\/tk9.png 614w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2018\/06\/tk9-320x211.png 320w\" sizes=\"auto, (max-width: 337px) 100vw, 337px\" \/><\/a><\/p>\n<p>We&#8217;ve seen how to insert a label and a button in a window with tkinter, the easiest module to make a GUI (graphic user interface) in Python. What now?<\/p>\n<h2>The entry widget<\/h2>\n<p>If we want the user to enter some text or numbers, we can use the Entry widget. The sintax is very similar to the one used for labels and buttons, but there is a great difference for the textvariable argument, that let&#8217;s us choose a variable in wich to store the text that the use input in the Entry widget. So, with the get() method we can grab this value and use it to elaborate it. But, shall we see some live coding in action?<\/p>\n<h2>Live coding in action: how to make and use an Entry widget in tkinter<\/h2>\n<p>Here is a little, but meaningful example, of how to put an Entry widget on the window and use a button to get and show (on a label) the content the user has entered into it. Let&#8217;s see how easy is that.<\/p>\n<p><iframe loading=\"lazy\" title=\"Python and GUI with tkinter: the entry widget to get the imput\" width=\"747\" height=\"420\" src=\"https:\/\/www.youtube.com\/embed\/-HMkZRG9zTU?feature=oembed&amp;enablejsapi=1\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>The code seen in this video<\/p>\n<pre class=\"lang:default decode:true\">import tkinter\r\n\r\nroot = tkinter.Tk()\r\nroot.geometry(\"400x400+400+400\")\r\n\r\ndef label_value():\r\n    listbox.insert(tkinter.END, textvar.get())\r\n    entry.set(\"\")\r\n\r\ntextvar = tkinter.StringVar()\r\nentry = tkinter.Entry(root, textvariable=textvar)\r\nentry['font'] = \"Arial 20\"\r\nentry.focus()\r\nentry.pack()\r\n\r\nentry.bind(\"&lt;Return&gt;\", lambda x: label_value())\r\n\r\nlistbox = tkinter.Listbox(root)\r\nlistbox.pack()\r\n\r\nroot.mainloop()<\/pre>\n<h2>Commented code<\/h2>\n<pre class=\"lang:default decode:true \">import tkinter\r\n\r\n# initiate the window\r\nroot = tkinter.Tk()\r\n# give width height top and left position\r\nroot.geometry(\"400x400+400+400\")\r\n\r\ndef insert_value_in_list():\r\n    \"insert as last item what inside entry (called when press enter)\"\r\n    listbox.insert(tkinter.END, textvar.get())\r\n    # and then clear the entry input box\r\n    entry.set(\"\")\r\n\r\n# this variable will get the text in the entry\r\ntextvar = tkinter.StringVar()\r\nentry = tkinter.Entry(root, textvariable=textvar)\r\n# the character famuly and size\r\nentry['font'] = \"Arial 20\"\r\n# when starts it focus on the entry to input text immediately\r\nentry.focus()\r\n# make the entry visible\r\nentry.pack()\r\n\r\n# attach to the entry the event 'enter' to go to label_value function\r\nentry.bind(\"&lt;Return&gt;\", lambda x: insert_value_in_list())\r\n\r\n# add the listbox\r\nlistbox = tkinter.Listbox(root)\r\nlistbox.pack()\r\n\r\nroot.mainloop()<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n\t<!----- pubblicit\u00e0-------- vedi h:\\ads\\codice_di_prima.txt per il codice che era qui --------------------->\r\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- Altervista-pythonprogramming-336X280 -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-4189782812829764\"\r\n     data-ad-slot=\"2548661001\"\r\n     data-ad-format=\"auto\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\r\n<h4>Tkinter test for students<\/h4>\r\n\r\n\r\n<script>\r\nvar title = \"Tkinter posts\";\r\n\t\tvar links = [\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-app-to-make-a-different-test-for-every-student-part-1\/\",\"Tk Test Marker I\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-testmaker-part-ii\/\",\"Tk Test Maker II\"],\t\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-tests-app-part-3\/\",\"Tk test Maker III\"]\r\n];\r\n\t\t\r\n\t<\/script>\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script>\r\n\t\r\n\r\n<h4>Tkinter articles<\/h4>\r\n<!-- calculator with memo -->\r\n<a href=\"https:\/\/pythonprogramming.altervista.org\/free-calculator-memo-with-tkinter-support-markdown-to-html-saving-too\/\">\r\n<img decoding=\"async\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2020\/03\/calcmemopy_banner.png\" width=\"100%\"><\/a>\r\n<script>\r\nvar title = \"Tkinter posts\";\r\n\t\tvar links = [\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/?p=5719&preview=true\",\"Presentation app with SVG files\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/png-joined-in-one-pdf-files\/\",\"Join png into pdf\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/free-app-imgslide-3-1-slide-images-and-join-them-into-a-pdf\/\",\"ImageSlider 3.1\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-to-show-svg-files-svgslider-1-0\/\",\"SVGSlider 1.0\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/imageslider-3-0-tkinter-app-to-show-images-like-in-a-presentation\/\",\"ImageSlider 3.0\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-shows-an-svg-file\/\",\"SVG in tkinter\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-tests-maker-app-part-iv-add-a-menu-with-tkinter\/\",\"Add a menu with tkinter\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/free-pdf-maker-app-with-python\/\",\"tkinter make pdf\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/calcpy-2-0-the-second-and-final-part-of-calculator\/\",\"Live coding Calculator app part 2\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/split-every-page-in-a-pdf-i-a-different-pdf\/\",\"Split a pdf in different files\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/python-calculator-from-skratch-part-1-calcpy\/\",\"Calculator from skratch p.1\"], \r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/python-and-tkinter-fully-working-listbox-to-do-app-for-skratch\/\",\"Tkinter ToDo App\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/copy-and-paste-tkinter-widget-code-app\/\",\"Copy and paste app for tkinter widgets\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/calcdoc-py-a-tkinter-app-to-memorize-operations\/\",\"calcdoc.py: a great calculator memo app\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-calculator-with-memo-of-operations\/\",\"Calculator + list of operations\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-smallest-calculator-ever\/\", \"Smallest calculator\"],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/python-gui-with-tkinter-labels-with-text-and-images\/\",\"Labels with images and text\"],\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/a-toolbar-for-python-with-tkinter\/\",\"Toolbar in tkinter\"],\r\n\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-grid-system-how-to-expand-a-button\/\",\"Fit Buttons to the Window\"],\r\n\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-application-launcher-python-gui\/\",\"Tkinter app Laucher\"],\r\n\t\t[\"https:\/\/pythonprogramming.altervista.org\/tkinter-and-how-to-add-an-image-to-a-button\/\", \"Image on a tkinter Button\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-imagebrowser-2-with-canvas\/\", \"Tkinter image browser 2 (canvas)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-image-broswer\/\",\"Tkinter image browser (label)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-to-make-pdf-fast-and-free-with-text-or-html\/\",\"Create PDF with Tkinter Text widget\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-app-to-evaluate-tests-part-1\/\",\"Tkinter App to Evaluate tests\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/simple-presentation-in-pure-python-while-you-learn-tkinter\/\",\"Presentation with Python\/tkinter\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-entry-widgets-example-make-a-shuffler-app\/\",\"Tkinter example: entry to shuffle lists\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/move-a-rectangle-with-text-inside-of-it-with-tkinter\/\",\"Moving a text with tkinter\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-and-ttk-the-option-menu-widget\/\",\"Tkinter's OptionMenu (and ttk)\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-app-to-watch-videos-with-live-coding\/\",\t\t\t\t\t\"Tkinter to watch videos\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/type-reader-app-in-python-pc-read-the-letters-you-type-tkinter\/\",\t\"Type Reader App\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/create-a-new-tkinter-widget-inputbox\/\",\t\t\t\t\t\t\t\"Create your Inputbox\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-open-a-new-window-and-just-one\/\", \t\t\t\t\t\t\"Open only one more window\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/a-simple-test-maker-with-python-and-tkinter\/\", \t\t\t\t\t\"Test maker with tkinter\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/my-personal-notepad-toggle-tkinter-fullscreen\/\",\t\t\t\t\t\"Ebook maker with tkinter\"],\r\n[\"https:\/\/pythonprogramming.altervista.org\/tkinter-and-listbox-1\/\", \t\t\t\t\t\t\t\t\t\t\t\"Tkinter & listbox 2019 - 1\"],\r\n['https:\/\/pythonprogramming.altervista.org\/tkinter-using-a-gui-graphic-user-interface-with-python-part-1\/', \t'Create a window'],\r\n['https:\/\/pythonprogramming.altervista.org\/tkinter-to-make-a-window-video-1\/', \t\t\t\t\t\t\t\t'Create a window part 2'],\r\n[\"https:\/\/pythonprogramming.altervista.org\/create-more-windows-with-tkinter\/\",\t\t\t\t\t\t\t\t\"More windows tkinter!\"],\r\n['https:\/\/pythonprogramming.altervista.org\/tkinter-part-2-binding\/', \t\t\t\t\t\t\t\t\t\t'Binding functions to key\/button '],\r\n\t\t\t[\"https:\/\/pythonprogramming.altervista.org\/all-tkinter-posts\/\",\">>>ALL TKINTER POSTS>>>\"]\r\n\t\t];\r\n\t\t\r\n\t<\/script>\r\n<script>\r\n\t\r\nif (typeof next2 != \"undefined\"){let next2 = 0;}\r\n\t\r\nnext2 = 0;\r\n\thtml = \"\";\/\/<b style='color:coral;font-size:1.2em'>Other posts about \" + title + \"<\/b><br>\";\r\nfor (address of links) \r\n{\r\n\r\n\tif (next2 == 1){\r\n\t\thtml += \"<div style='background:coral'>\";\r\n\t\thtml += \"Next link => <a href='\" + address[0] + \"'>\" + address[1] + \"<\/a>\";\r\n\t\thtml += \"<\/div><br>\";\r\n\t\tnext2 = 0;\r\n\t}\r\n\tif (address[0] == document.URL) {\r\n\t\tnext2 = 1;\r\n\t}\r\n}\r\n\r\nif (typeof next != \"undefined\") {let next = 0;}\r\nif (typeof addressStart != \"undefined\") {let addressStart = \"\";}\r\nnext = 0;\r\naddressStart = \"<a href='\";\r\nfor (address of links) {\r\n\tif (next == 1){\r\n\t\thtml += \">>>\" + addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t\tnext = 0;\r\n\t}\r\n\telse if (addressStart + address[0] != document.URL)\r\n\t{\r\n\t\thtml += addressStart + address[0] + \"'>\" + address[1] + \"<\/a><br>\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\tnext = 1;\r\n\t\tnext_address = address[0]\r\n\t\tnext_title = address[1]\r\n\t\thtml += \"<span style='color:gray'>\" + address[1] + \"<\/span><br>\";\r\n\t}\r\n\r\n}\r\n\r\n\thtml += `<span style=\"font-size:8px\">Powered by <a href=\"https:\/\/pythonprogramming.altervista.org\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2673\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png\" alt=\"\" width=\"70\" height=\"25\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2.png 156w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/06\/altervista2-150x56.png 150w\" sizes=\"auto, (max-width: 70px) 100vw, 70px\" \/>pythonprogramming.altervista.org<\/a><\/span>`\r\n\thtml = \"<div style='background:yellow'>\" + html + \"<\/div>\";\r\n\tdocument.write(html)\r\n<\/script>\n","protected":false},"excerpt":{"rendered":"The way to get the user input with the entry widget in tkinter, with Python 3, making a very simple GUI, graphic user interface.\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/tkinter-9-entry-widget\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":2350,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1,49,50],"tags":[119,52,73,118,51],"class_list":["post-311","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-examples","category-tkinter","category-video","tag-entry","tag-gui","tag-label","tag-listbox","tag-tkinter"],"avopt_banners_inside_post":true,"avopt_banners_on_page":true,"av_copy_from":"","av_sharing_message":"","av_sharing_allowed":false,"av_sharing_on":{"fb":[],"tw":[]},"av_allow_affiliate_banner":false,"av_allow_affiliate_multi_banner":false,"av_show_affiliation_buy_button":false,"av_post_rating":true,"av_have_post_rating_value":false,"av_is_artificial_intelligence_content":false,"_links":{"self":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/comments?post=311"}],"version-history":[{"count":24,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/311\/revisions"}],"predecessor-version":[{"id":4676,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/311\/revisions\/4676"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/2350"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}