{"id":3874,"date":"2019-10-03T13:19:25","date_gmt":"2019-10-03T11:19:25","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=3874"},"modified":"2019-10-05T17:31:24","modified_gmt":"2019-10-05T15:31:24","slug":"create-and-html-table-with-python-and-tkinter","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/create-and-html-table-with-python-and-tkinter\/","title":{"rendered":"Create and HTML table with Python and tkinter"},"content":{"rendered":"<h2>The whole code<\/h2>\n<p>With this code we can create our table in html, starting from a table made in Excel like this:<\/p>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/excel_table.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3875\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/excel_table.png\" alt=\"\" width=\"678\" height=\"631\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/excel_table.png 678w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/excel_table-320x298.png 320w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/a><\/p>\n<p>then, due to the need to convert this table in an html table, we copy it (ctrl+c) and paste it into our application. Then we press convert, then we save it and we show the table with the menu command save and show.<\/p>\n<p>Here is the GUI when we copied the Excel data:<\/p>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/gui1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3880\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/gui1.png\" alt=\"\" width=\"646\" height=\"461\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/gui1.png 646w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/gui1-320x228.png 320w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/gui1-321x229.png 321w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/a><\/p>\n<p>Then we press convert and we have this:<\/p>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/convert.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3881\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/convert.png\" alt=\"\" width=\"646\" height=\"461\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/convert.png 646w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/convert-320x228.png 320w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/convert-321x229.png 321w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/a><\/p>\n<p>You can see the data converted into html table. You then save and show the html file with the two commands in the menu. This is the output (the one above is not a picture, we used the html code generated above)<\/p>\n<!-- table --><table border=1><td>N.<\/td><td>Bene_A_4%<\/td><td>Bene_B_10%<\/td><td>Trasporto<\/td><td>CDR<\/td><td>Trasp_A<\/td><td>trasp_B<\/td><td>IVA_A<\/td><td>IVA_B<\/td><td>TOT<\/td><tr><td>1<\/td><td>1200,00<\/td><td>800,00<\/td><td>100,00<\/td><td>0,05<\/td><td>60,00<\/td><td>40,00<\/td><td>50,40<\/td><td>84,00<\/td><td>2234,40<\/td><tr><td>2<\/td><td>1400,00<\/td><td>900,00<\/td><td>120,00<\/td><td>0,05<\/td><td>73,04<\/td><td>46,96<\/td><td>58,92<\/td><td>94,70<\/td><td>2573,62<\/td><tr><td>3<\/td><td>1600,00<\/td><td>1000,00<\/td><td>140,00<\/td><td>0,05<\/td><td>86,15<\/td><td>53,85<\/td><td>67,45<\/td><td>105,38<\/td><td>2912,83<\/td><tr><td>4<\/td><td>1800,00<\/td><td>1100,00<\/td><td>160,00<\/td><td>0,06<\/td><td>99,31<\/td><td>60,69<\/td><td>75,97<\/td><td>116,07<\/td><td>3252,04<\/td><tr><td>5<\/td><td>2000,00<\/td><td>1200,00<\/td><td>180,00<\/td><td>0,06<\/td><td>112,50<\/td><td>67,50<\/td><td>84,50<\/td><td>126,75<\/td><td>3591,25<\/td><tr><tr><\/table>\n<h2>The whole code<\/h2>\n<p>This is the whole code to make this simple but useful app.<\/p>\n<pre class=\"lang:default decode:true\">import os\r\n\r\n\r\nhtml = \"\"\r\ndef table(x):\r\n\tglobal html\r\n\t\"\"\" Create table with data in a multiline\r\n\tstring as first argument x)\"\"\"\r\n\thtml = \"&lt;!-- table --&gt;\"\r\n\thtml += \"&lt;table border=1&gt;\"\r\n\tfor line in x.splitlines():\r\n\t\tfor n in line.split():\r\n\t\t\thtml += f\"&lt;td&gt;{n}&lt;\/td&gt;\"\r\n\t\thtml += \"&lt;tr&gt;\"\r\n\thtml += \"&lt;\/table&gt;\"\r\n\treturn html\r\n\r\ndef create(a):\r\n\ttab = table(text.get(\"1.0\", tk.END))\r\n\ttext.delete(\"1.0\", tk.END)\r\n\ttext.insert(\"1.0\", tab)\r\n\tlabel['text'] = \"Now you can copy the html code for the table (ctrl + a)\"\r\n\r\ndef save_html():\r\n\tif html != \"\":\r\n\t\twith open(\"table.html\", \"w\") as file:\r\n\t\t\tfile.write(text.get(\"1.0\", tk.END))\r\n\r\ndef show_html():\r\n\tif os.path.exists(\"table.html\"):\r\n\t\tos.startfile(\"table.html\")\r\n\r\ndef convert_to_html():\r\n\thtml = table(text.get(\"1.0\",tk.END))\r\n\tclear()\r\n\ttext.insert(\"1.0\", html)\r\n\r\ndef clear():\r\n\ttext.delete(\"1.0\", tk.END)\r\n\r\nimport tkinter as tk\r\nroot = tk.Tk()\r\nroot.title(\"Html table converter\")\r\nlabel = tk.Label(root, text=\"Insert data here separated by space and press Ctrl+c to convert to html table:\")\r\nlabel.pack()\r\ntext = tk.Text(root)\r\ntext.pack()\r\ntext.bind(\"&lt;Control-c&gt;\", create)\r\ntext.focus()\r\n# create a toplevel menu \r\nmenubar = tk.Menu(root)\r\nmenubar.add_command(label=\"Convert - crtl+c |\", command=convert_to_html)\r\nmenubar.add_command(label=\"Save  |\", command=save_html)\r\nmenubar.add_command(label=\"Show  |\", command=show_html)\r\nmenubar.add_command(label=\"Clear screen  |\", command=clear)\r\n# display the menu\r\nroot.config(menu=menubar)\r\nroot.mainloop()\r\n<\/pre>\n<p>*update: addet crtl+c as shortcut to convert data into html<\/p>\n<h2>Version 2<\/h2>\n<p>In this version we have two text box, the first for the text, the second with the html. In this version you separare the cells with tabs, so that you can use a space between words in the same cell (otherwise, it would separate each word into different cells, having you to write two words like this first_second, to avoid splitting the single words into different cells.<\/p>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/version2table.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3901\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/version2table.png\" alt=\"\" width=\"646\" height=\"326\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/version2table.png 646w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/version2table-320x161.png 320w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/a><\/p>\n<p>The code:<\/p>\n<pre class=\"lang:default decode:true \">import os\r\n\r\n\r\nhtml = \"\"\r\ndef table(x):\r\n\tglobal html\r\n\thtml = \"\"\r\n\t\"\"\" Create table with data in a multiline\r\n\tstring as first argument x)\"\"\"\r\n\thtml = \"&lt;!-- table --&gt;\"\r\n\thtml += \"&lt;table border=1&gt;\"\r\n\tfor line in x.splitlines():\r\n\t\tfor n in line.split(\"\\t\"):\r\n\t\t\thtml += f\"&lt;td&gt;{n}&lt;\/td&gt;\"\r\n\t\thtml += \"&lt;tr&gt;\"\r\n\thtml += \"&lt;\/table&gt;\"\r\n\treturn html\r\n\r\ndef create(a):\r\n\ttab = table(text.get(\"1.0\", tk.END))\r\n\t#text.delete(\"1.0\", tk.END)\r\n\ttext2.insert(\"1.0\", tab)\r\n\tlabel['text'] = \"Now you can copy the html code for the table (ctrl + a)\"\r\n\r\ndef save_html():\r\n\tif html != \"\":\r\n\t\twith open(\"table.html\", \"w\", encoding=\"utf-8\") as file:\r\n\t\t\tfile.write(text2.get(\"1.0\", tk.END))\r\n\r\ndef show_html():\r\n\tif os.path.exists(\"table.html\"):\r\n\t\tos.startfile(\"table.html\")\r\n\r\ndef convert_to_html():\r\n\thtml = table(text.get(\"1.0\",tk.END))\r\n\tclear2()\r\n\ttext2.insert(\"1.0\", html)\r\n\r\ndef clear2():\r\n\ttext2.delete(\"1.0\", tk.END)\r\n\r\ndef clear():\r\n\ttext.delete(\"1.0\", tk.END)\r\n\ttext2.delete(\"1.0\", tk.END)\r\n\r\nimport tkinter as tk\r\nroot = tk.Tk()\r\nroot.title(\"Html table converter\")\r\nlabel = tk.Label(root, text=\"Insert data here separated by tabs\")\r\nlabel.pack()\r\ntext = tk.Text(root, height=7)\r\ntext.pack()\r\ntext.bind(\"&lt;Control-p&gt;\", create)\r\ntext.focus()\r\nlabel2 = tk.Label(root, text=\"Press ctr+p and you'll get the html code here\")\r\nlabel2.pack()\r\ntext2 = tk.Text(root, bg='gold', height=7)\r\ntext2.pack()\r\n# create a toplevel menu \r\nmenubar = tk.Menu(root)\r\nmenubar.add_command(label=\"Convert - crtl+p |\", command=convert_to_html)\r\nmenubar.add_command(label=\"Save  |\", command=save_html)\r\nmenubar.add_command(label=\"Show  |\", command=show_html)\r\nmenubar.add_command(label=\"Clear screen  |\", command=clear)\r\n# display the menu\r\nroot.config(menu=menubar)\r\nroot.mainloop()\r\n<\/pre>\n<h2>Version 3: filedialog<\/h2>\n<p>Now you can open a <strong>txt<\/strong> file with the data from a <strong>filedialog<\/strong> window called by <strong>tkinter<\/strong>. This way, you can save your data into a txt file, so that you can change them and convert them easily with the app into a html table. Now it is also possible to <strong>clean the html tags<\/strong> and get back the cleaned data, pasting (or opening) a html code\/file.<\/p>\n<pre class=\"lang:default decode:true \">import tkinter as tk\r\nimport os\r\nfrom tkinter import filedialog\r\n\r\n\r\nmy_filetypes = [('python', '.py'), ('html', '.html'), ('text files', '.txt')]\r\ndef open_folder():\r\n\tanswer = filedialog.askopenfilename(parent=root,\r\n                                    initialdir=os.getcwd(),\r\n                                    title=\"Please select a file:\",\r\n                                    filetypes=my_filetypes)\r\n\ttry:\r\n\t\ttext.delete(\"1.0\", tk.END)\r\n\t\twith open(answer) as file:\r\n\t\t\ttext.insert(\"1.0\", file.read())\r\n\texcept FileNotFoundError:\r\n\t\tprint(\"file not found\")\r\n\r\ndef convert_reverse(x):\r\n\ttags = [\r\n\t\t(\"&lt;\/table&gt;\",\"\"),\r\n\t\t(\"&lt;!-- table --&gt;\",\"\"),\r\n\t\t(\"&lt;table border=1&gt;\",\"\"),\r\n\t\t(\"&lt;td&gt;\",\"\\t\"),\r\n\t\t(\"&lt;\/td&gt;\", \"\"),\r\n\t\t(\"&lt;tr&gt;\", \"\\n\")]\r\n\tfor tag in tags:\r\n\t\tx = x.replace(tag[0], tag[1])\r\n\treturn x\r\n\r\nhtml = \"\"\r\ndef table(x):\r\n\tglobal html\r\n\tif \"&lt;table\" in x:\r\n\t\treturn convert_reverse(x)\r\n\thtml = \"\"\r\n\t\"\"\" Create table with data in a multiline\r\n\tstring as first argument x)\"\"\"\r\n\thtml += \"&lt;table border=1&gt;\"\r\n\tfor line in x.splitlines():\r\n\t\tfor n in line.split(\"\\t\"):\r\n\t\t\tif n == \"\":\r\n\t\t\t\tcontinue\r\n\t\t\thtml += f\"&lt;td&gt;{n}&lt;\/td&gt;\"\r\n\t\thtml += \"&lt;tr&gt;\"\r\n\thtml += \"&lt;\/table&gt;\"\r\n\treturn html\r\n\r\ndef create(a):\r\n\ttab = table(text.get(\"1.0\", tk.END))\r\n\t#text.delete(\"1.0\", tk.END)\r\n\ttext2.insert(\"1.0\", tab)\r\n\tlabel['text'] = \"Now you can copy the html code for the table (ctrl + a)\"\r\n\r\ndef save_html():\r\n\tif html != \"\":\r\n\t\twith open(\"table.html\", \"w\", encoding=\"utf-8\") as file:\r\n\t\t\tfile.write(text2.get(\"1.0\", tk.END))\r\n\r\ndef show_html():\r\n\tif os.path.exists(\"table.html\"):\r\n\t\tos.startfile(\"table.html\")\r\n\r\ndef convert_to_html():\r\n\thtml = table(text.get(\"1.0\",tk.END))\r\n\tclear2()\r\n\ttext2.insert(\"1.0\", html)\r\n\r\ndef clear2():\r\n\ttext2.delete(\"1.0\", tk.END)\r\n\r\ndef clear():\r\n\ttext.delete(\"1.0\", tk.END)\r\n\ttext2.delete(\"1.0\", tk.END)\r\n\r\nroot = tk.Tk()\r\nroot.title(\"Html table converter\")\r\nlabel = tk.Label(root, text=\"Copy data from Excel and insert them here separated by tabs\")\r\nlabel.pack()\r\ntext = tk.Text(root)\r\ntext.pack(fill=tk.BOTH, expand=1)\r\ntext.bind(\"&lt;Control-p&gt;\", create)\r\ntext.focus()\r\nlabel2 = tk.Label(root, text=\"Press ctr+p and you'll get the html code here\")\r\nlabel2.pack()\r\ntext2 = tk.Text(root, bg='gold')\r\ntext2.pack(fill=tk.BOTH, expand=1)\r\n# create a toplevel menu \r\nmenubar = tk.Menu(root)\r\nmenubar.add_command(label=\"Open\", command=open_folder)\r\nmenubar.add_command(label=\"Convert\", command=convert_to_html)\r\nmenubar.add_command(label=\"Save\", command=save_html)\r\nmenubar.add_command(label=\"Show\", command=show_html)\r\nmenubar.add_command(label=\"Clear\", command=clear)\r\n# display the menu\r\nroot.config(menu=menubar)\r\nroot.mainloop()<\/pre>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/opendialog.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3910\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/opendialog.png\" alt=\"\" width=\"911\" height=\"586\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/opendialog.png 911w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/opendialog-320x206.png 320w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/10\/opendialog-768x494.png 768w\" sizes=\"auto, (max-width: 911px) 100vw, 911px\" \/><\/a><\/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":"From Excel to html data via Python and tkinter\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/create-and-html-table-with-python-and-tkinter\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":3885,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1,586,49],"tags":[4,587,51],"class_list":["post-3874","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-examples","category-tables","category-tkinter","tag-python","tag-table-html","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\/3874","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=3874"}],"version-history":[{"count":8,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/3874\/revisions"}],"predecessor-version":[{"id":3912,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/3874\/revisions\/3912"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/3885"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=3874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=3874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=3874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}