{"id":3649,"date":"2019-09-16T19:32:43","date_gmt":"2019-09-16T17:32:43","guid":{"rendered":"https:\/\/pythonprogramming.altervista.org\/?p=3649"},"modified":"2019-10-20T09:10:37","modified_gmt":"2019-10-20T07:10:37","slug":"a-simple-test-maker-with-python-and-tkinter","status":"publish","type":"post","link":"https:\/\/pythonprogramming.altervista.org\/a-simple-test-maker-with-python-and-tkinter\/","title":{"rendered":"A Free Test Maker with Python and Tkinter"},"content":{"rendered":"<p>Due to a request, I made this simple code to make a test with tkinter. It is very rough, but the logic works, so that\u00a0 you can make the adjustment you want to make it seem prettier.<\/p>\n<h2>The starting window<\/h2>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3650 aligncenter\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test1.png\" alt=\"\" width=\"465\" height=\"559\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test1.png 465w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test1-320x385.png 320w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a>In the main window there is a little explanation of what to do.<\/p>\n<pre class=\"lang:default decode:true \">import tkinter as tk\r\n\r\nroot = tk.Tk()\r\nlabel = tk.Label(root, text=\"TEST\", bg=\"gold\", fg=\"blue\", font=\"Arial 24\")\r\nlabel.pack()\r\ntext = tk.Text(root)\r\ntext.pack()\r\nroot.mainloop()<\/pre>\n<p>This is the window with the label and a text widget. Let&#8217;s add the code to create the questions.<\/p>\n<h2>The window for the test<\/h2>\n<p>Your question go here:<\/p>\n<pre class=\"lang:default decode:true \">quest = [\r\n\t\t(\"what is 1+1?\",\"2\"),\r\n\t\t(\"What is 50*2?\",\"100\"),\r\n\t\t(\"What is the capital of Italy?\", \"Rome\")\r\n]<\/pre>\n<p>This is where you put your questions and answers. It&#8217;s all you need to change to personalize the test. It will work with as many questions you want.<\/p>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3651 aligncenter\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test2.png\" alt=\"\" width=\"402\" height=\"232\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test2.png 402w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test2-320x185.png 320w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/a>The question will have this way to show themselves. There is the focus on the entry, so that you can answer without having to position yourself on the widget with the mouse. You just write and then hit Enter&#8230; and you go to the next question. As fast as you want.<\/p>\n<h2>The final window<\/h2>\n<p><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3652 aligncenter\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test3.png\" alt=\"\" width=\"402\" height=\"232\" srcset=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test3.png 402w, https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test3-320x185.png 320w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/a>When the test ends, you see the score and you can close the window pressing the button.<\/p>\n<h2>The entire code<\/h2>\n<p>This is the code of the program to make tests with python and tkinter.<\/p>\n<pre class=\"lang:default decode:true \">import tkinter as tk\r\n\r\nquest = [\r\n\t\t(\"what is 1+1?\",\"2\"),\r\n\t\t(\"What is 50*2?\",\"100\"),\r\n\t\t(\"What is the capital of Italy?\", \"Rome\")\r\n]\r\nnumdom = len(quest)\r\nscore = 0\r\nnum = 0\r\ndef d1():\r\n\tglobal num, score, entry\r\n\tif num == numdom:\r\n\t\ttext.pack_forget()\r\n\t\tentry.pack_forget()\r\n\t\tbutton['text'] = f\"Score {score}\\n Click to Close this window\"\r\n\t\tbutton['command'] = game_over\r\n\t\tbutton.pack()\r\n\t\treturn\r\n\r\n\tif num == 0:\r\n\t\tanswer_widget()\r\n\troot.geometry(\"400x200+100+200\")\r\n\ttext['height'] = 1\r\n\ttext['bg'] = 'cyan'\r\n\ttext['width'] = 50\r\n\ttext.delete(\"1.0\",tk.END)\r\n\ttext.insert(\"1.0\",quest[num][0])\r\n\tbutton.pack_forget()\r\n\tnum+=1\r\n\r\ndef game_over():\r\n\troot.destroy()\r\n\r\ndef answer_widget():\r\n\tglobal entry\r\n\tentry = tk.Entry(root, textvariable=solution, bg=\"yellow\", font=\"Arial 20\")\r\n\tentry.pack()\r\n\tentry.bind(\"&lt;Return&gt;\", lambda x: check())\r\n\tentry.focus()\r\n\r\ndef check():\r\n\tglobal n, score\r\n\tif solution.get() == quest[num-1][1]:\r\n\t\ttext.insert(tk.END, \"Right\")\r\n\t\tscore+=1\r\n\telse:\r\n\t\ttext.insert(tk.END, \"Wrong\")\r\n\tsolution.set(\"\")\r\n\td1()\r\n\r\nroot = tk.Tk()\r\nlabel = tk.Label(root, text = \"\"\"Test\"\"\", bg=\"coral\", font=\"Arial 48\")\r\nlabel.pack()\r\nrules = \"\"\"Answer to the Following questions\r\n\r\nClick on the button below to start\r\nYou will see a question\r\nWrite your answer and press Enter\r\n\"\"\"\r\ntext = tk.Text(root, height=12,font=\"Arial 20\")\r\ntext.insert(\"1.0\", rules)\r\ntext.pack()\r\nbutton = tk.Button(root, text=\"Click To Start\", bg=\"black\", fg=\"white\", command=d1, font=\"Arial 20\")\r\nbutton.pack()\r\nsolution = tk.StringVar()\r\n\r\nroot.mainloop()\r\n\r\n<\/pre>\n<h2>A video that shows the output of the test program<\/h2>\n<div style=\"width: 747px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3649-1\" width=\"747\" height=\"420\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test_output.mp4?_=1\" \/><a href=\"https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test_output.mp4\">https:\/\/pythonprogramming.altervista.org\/wp-content\/uploads\/2019\/09\/test_output.mp4<\/a><\/video><\/div>\n<h2>Some changes in the score<\/h2>\n<p>I added some more features:<\/p>\n<ul>\n<li>You can see if the answer is right or wrong after each answer<\/li>\n<li>There is a little pause among questions to let you see the result<\/li>\n<li>you can see the total score<\/li>\n<li>you get a percentage of the result at the end<\/li>\n<li>color changes if you are wright or wrong<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true \">import tkinter as tk\r\n\r\n\r\nquest = [\r\n\t\t#1\r\n\t\t(\"\"\"I Paesi che negli ultimi anni hanno\r\nregistrato elevati aumenti di spese per il\r\nturismo outgoing sono la Cina e la Russia.\"\"\",\"v\"),\r\n\t\t#2\r\n\t\t(\"\"\"\r\nSecondo l\u2019OMT un visitatore \u00e8 considerato\r\nun turista se effettua almeno tre\r\npernottamenti nella localit\u00e0 visitata.\r\n\t\t\t\"\"\",\"f\"),\r\n\t\t#3\r\n\t\t(\"\"\"Nel 2014 il continente pi\u00f9 visitato dai\r\nturisti di tutto il mondo \u00e8 stato l\u2019Asia.\"\"\", \"f\"),\r\n#4\r\n(\"\"\"Negli ultimi anni i flussi turistici\r\ninternazionali sono cresciuti a un tasso\r\nmedio del 4,5% l\u2019anno.\r\n\"\"\",\"v\")\r\n\r\n]\r\nnumdom = len(quest)\r\nscore = 0\r\nnum = 0\r\ndef d1():\r\n\tglobal num, score, entry\r\n\tif num == numdom:\r\n\t\ttext.pack_forget()\r\n\t\tentry.pack_forget()\r\n\t\tscore = score \/ num * 100\r\n\t\tbutton['text'] = f\"Score {score}%\\n Click to Close this window\"\r\n\t\tbutton['command'] = game_over\r\n\t\tbutton.pack()\r\n\t\treturn\r\n\r\n\tif num == 0:\r\n\t\tanswer_widget()\r\n\ttext['height'] = 7\r\n\ttext['bg'] = 'cyan'\r\n\ttext['width'] = 80\r\n\ttext.delete(\"1.0\",tk.END)\r\n\ttext.insert(\"1.0\",quest[num][0] + \"[v][f]\")\r\n\tbutton.pack_forget()\r\n\tnum+=1\r\n\r\ndef game_over():\r\n\tglobal score\r\n\tprint(score)\r\n\troot.destroy()\r\n\r\ndef answer_widget():\r\n\tglobal entry\r\n\tentry = tk.Entry(root, textvariable=solution, bg=\"yellow\", font=\"Arial 20\")\r\n\tentry.pack()\r\n\tentry.bind(\"&lt;Return&gt;\", lambda x: check())\r\n\tentry.focus()\r\n\r\ndef empty_textbox():\r\n\t\tsolution.set(\"\")\r\n\t\td1()\r\n\r\ndef check():\r\n\tglobal n, score\r\n\ttext.delete(\"1.0\",tk.END)\r\n\tif solution.get() == quest[num-1][1]:\r\n\t\ttext.insert(tk.END, \"Right +1\")\r\n\t\tscore+=1\r\n\t\ttext['bg'] = \"green\"\r\n\telse:\r\n\t\ttext.insert(tk.END, \"Wrong 0 points\")\r\n\t\ttext['bg'] = \"red\"\r\n\tlabel['text'] = score\r\n\ttext.after(1000, empty_textbox)\r\n\r\nroot = tk.Tk()\r\nlabel = tk.Label(root, text = \"\"\"Test\"\"\", bg=\"coral\", font=\"Arial 48\")\r\nlabel.pack()\r\nrules = \"\"\"Answer to the Following questions\r\n\r\nClick on the button below to start\r\nYou will see a question\r\nWrite your answer and press Enter\r\n\"\"\"\r\ntext = tk.Text(root, height=12,font=\"Arial 20\")\r\ntext.insert(\"1.0\", rules)\r\ntext.pack()\r\nbutton = tk.Button(root, text=\"Click To Start\", bg=\"black\", fg=\"white\", command=d1, font=\"Arial 20\")\r\nbutton.pack()\r\nsolution = tk.StringVar()\r\n\r\nroot.mainloop()<\/pre>\n<h2>A test with 2 possible answer in no time at all<\/h2>\n<p>Let&#8217;s see how we can adapt the code so that we do not have to write all the questions with the answer alongside when you have just to possible answer, like in true false test or any other test with the same two (or three, four&#8230;) possible answer. How you do it?<\/p>\n<h3>1. Create a list for each answer<\/h3>\n<pre class=\"lang:default decode:true \">f = \"\"\"Denaro in Cassa\r\nBanca x c\/c\r\nCrediti v\/clienti\r\nDebiti v\/fornitori\r\nIva a ns credito\r\nIva a ns debito\r\nMutui passivi\r\nRatei passivi\r\nRatei crediti\r\n\"\"\".splitlines()<\/pre>\n<p>The list above contains the list that has &#8220;f&#8221; (financial accounts)<\/p>\n<pre class=\"lang:default decode:true \">e = \"\"\"Merci c\/acquisti\r\nMerci c\/vendite\r\nAttrezzature\r\nStipendi\r\nArredi\r\nBrevetti\r\nSoftware\r\nComputer\r\nTovagliato\r\nUtenze elettriche\r\nUtenze telefoniche\r\n\"\"\".splitlines()<\/pre>\n<p>This are the economic accounts list.<\/p>\n<p>Then we join and shuffle these lists into one:<\/p>\n<pre class=\"lang:default decode:true\">num_questions = len(f) + len(e)\r\n\r\nfe = f + e\r\nshuffle(fe)<\/pre>\n<pre class=\"lang:default decode:true\">answer = []\r\nfor q in fe:\r\n\tif q in f:\r\n\t\tanswer.append(\"f\")\r\n\telse:\r\n\t\tanswer.append(\"e\")<\/pre>\n<p>Above we created a list with the solution of the fe shuffled accounts<\/p>\n<p>Now we have to take this data into the quest list of tuples that we used in the program to make our question. The quest data are tuples with a question and the answer as items of the tuple. We get the first by the fe list and the seccond by the answer list.<\/p>\n<pre class=\"lang:default decode:true \">quest = []\r\nfor n in range(num_questions):\r\n\tquest.append((fe[n], answer[n]))<\/pre>\n<p>Now that we built our data into quest, the code can do his job like it always did when we were adding manually each question. That is why I entitles &#8230;. in no time. This can be adapted to True False or other tests with other alternative (also more than 2 lists).<\/p>\n<h3>The whole code<\/h3>\n<pre class=\"lang:default decode:true \">import tkinter as tk\r\nfrom random import shuffle\r\n\r\nf = \"\"\"Denaro in Cassa\r\nBanca x c\/c\r\nCrediti v\/clienti\r\nDebiti v\/fornitori\r\nIva a ns credito\r\nIva a ns debito\r\nMutui passivi\r\nRatei passivi\r\nRatei crediti\r\n\"\"\".splitlines()\r\n\r\ne = \"\"\"Merci c\/acquisti\r\nMerci c\/vendite\r\nAttrezzature\r\nStipendi\r\nArredi\r\nBrevetti\r\nSoftware\r\nComputer\r\nTovagliato\r\nUtenze elettriche\r\nUtenze telefoniche\r\n\"\"\".splitlines()\r\n\r\nnum_questions = len(f) + len(e)\r\n\r\nfe = f + e\r\nshuffle(fe)\r\n\r\n\r\nanswer = []\r\nfor q in fe:\r\n\tif q in f:\r\n\t\tanswer.append(\"f\")\r\n\telse:\r\n\t\tanswer.append(\"e\")\r\n\r\nquest = []\r\nfor n in range(num_questions):\r\n\tquest.append((fe[n], answer[n]))\r\n\r\nprint(quest)\r\n\r\n\r\nnumdom = len(quest)\r\nscore = 0\r\nnum = 0\r\ndef d1():\r\n\tglobal num, score, entry\r\n\tif num == numdom:\r\n\t\ttext.pack_forget()\r\n\t\tentry.pack_forget()\r\n\t\tscore = score \/ num * 100\r\n\t\tbutton['text'] = f\"Score {score}%\\n Click to Close this window\"\r\n\t\tbutton['command'] = game_over\r\n\t\tbutton.pack()\r\n\t\treturn\r\n\r\n\tif num == 0:\r\n\t\tanswer_widget()\r\n\ttext['height'] = 7\r\n\ttext['bg'] = 'cyan'\r\n\ttext['width'] = 80\r\n\ttext.delete(\"1.0\",tk.END)\r\n\ttext.insert(\"1.0\",quest[num][0] + \"\\n\\n Choose among [f][e]\")\r\n\tbutton.pack_forget()\r\n\tnum+=1\r\n\r\ndef game_over():\r\n\tglobal score\r\n\tprint(score)\r\n\troot.destroy()\r\n\r\ndef answer_widget():\r\n\tglobal entry\r\n\tentry = tk.Entry(root, textvariable=solution, bg=\"yellow\", font=\"Arial 20\")\r\n\tentry.pack()\r\n\tentry.bind(\"&lt;Return&gt;\", lambda x: check())\r\n\tentry.focus()\r\n\r\ndef empty_textbox():\r\n\t\tsolution.set(\"\")\r\n\t\td1()\r\n\r\ndef check():\r\n\tglobal n, score\r\n\ttext.delete(\"1.0\",tk.END)\r\n\tif solution.get() == quest[num-1][1]:\r\n\t\ttext.insert(tk.END, \"Right +1\")\r\n\t\tscore+=1\r\n\t\ttext['bg'] = \"green\"\r\n\telse:\r\n\t\ttext.insert(tk.END, \"Wrong 0 points\")\r\n\t\ttext['bg'] = \"red\"\r\n\tlabel['text'] = score\r\n\ttext.after(1000, empty_textbox)\r\n\r\nroot = tk.Tk()\r\nlabel = tk.Label(root, text = \"\"\"Test\"\"\", bg=\"coral\", font=\"Arial 48\")\r\nlabel.pack()\r\nrules = \"\"\"Answer to the Following questions\r\n\r\nClick on the button below to start\r\nYou will see a question\r\nWrite your answer and press Enter\r\n\"\"\"\r\ntext = tk.Text(root, height=12,font=\"Arial 20\")\r\ntext.insert(\"1.0\", rules)\r\ntext.pack()\r\nbutton = tk.Button(root, text=\"Click To Start\", bg=\"black\", fg=\"white\", command=d1, font=\"Arial 20\")\r\nbutton.pack()\r\nsolution = tk.StringVar()\r\n\r\nroot.mainloop()<\/pre>\n<p><iframe loading=\"lazy\" title=\"Python test maker (live code) - Add answers in no time\" width=\"747\" height=\"420\" src=\"https:\/\/www.youtube.com\/embed\/9lqQe6q6suo?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>&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":"This is the code of the program to make tests with python and tkinter (updated 30\/09\/2019)\n<a class=\"moretag\" href=\"https:\/\/pythonprogramming.altervista.org\/a-simple-test-maker-with-python-and-tkinter\/\"> [...]<\/a>","protected":false},"author":1,"featured_media":3657,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[122,49],"tags":[561,4,557,51],"class_list":["post-3649","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gui","category-tkinter","tag-free","tag-python","tag-test-maker","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\/3649","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=3649"}],"version-history":[{"count":9,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/3649\/revisions"}],"predecessor-version":[{"id":3869,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/posts\/3649\/revisions\/3869"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media\/3657"}],"wp:attachment":[{"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/media?parent=3649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/categories?post=3649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pythonprogramming.altervista.org\/wp-json\/wp\/v2\/tags?post=3649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}