{"id":7324,"date":"2025-04-01T03:09:58","date_gmt":"2025-04-01T03:09:58","guid":{"rendered":"https:\/\/www.pythontutorial.net\/?page_id=7324"},"modified":"2025-04-01T03:53:16","modified_gmt":"2025-04-01T03:53:16","slug":"tkinter-intvar","status":"publish","type":"page","link":"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-intvar\/","title":{"rendered":"Tkinter IntVar"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: In this tutorial, you&#8217;ll learn how to link widgets with Python variables using the Tkinter <code>IntVar<\/code> objects.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-the-tkinter-intvar'>Introduction to the Tkinter IntVar <a href=\"#introduction-to-the-tkinter-intvar\" class=\"anchor\" id=\"introduction-to-the-tkinter-intvar\" title=\"Anchor for Introduction to the Tkinter IntVar\">#<\/a><\/h2>\n\n\n\n<p>In Tkinter, the&nbsp;<code>IntVar<\/code>&nbsp;class allows you to create integer variable objects.<\/p>\n\n\n\n<p>An&nbsp;<code>IntVar<\/code>&nbsp;object holds an integer value. Tkinter links an&nbsp;<code>IntVar<\/code>&nbsp;object with a widget, such as an <a href=\"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-entry\/\">entry<\/a>, <a href=\"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-checkbox\/\">checkbox<\/a>, or <a href=\"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-radio-button\/\">radio button<\/a>.<\/p>\n\n\n\n<p>By using&nbsp;<code>IntVar<\/code>&nbsp;objects, you can dynamically manage the widget&#8217;s values in Python.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"creating-and-associating-an-intvar-object-with-a-widget\" id='creating-and-associating-an-intvar-object-with-a-widget'>Creating and Associating an IntVar Object with a Widget <a href=\"#creating-and-associating-an-intvar-object-with-a-widget\" class=\"anchor\" id=\"creating-and-associating-an-intvar-object-with-a-widget\" title=\"Anchor for Creating and Associating an IntVar Object with a Widget\">#<\/a><\/h3>\n\n\n\n<p>Here are the steps for using the&nbsp;<code>IntVar<\/code>&nbsp;objects:<\/p>\n\n\n\n<p>First, import the <code>tkinter<\/code> module:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import<\/span> tkinter <span class=\"hljs-keyword\">as<\/span> tk<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Second, create a new <code>IntVar<\/code> object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">quantity_var = tk.IntVar()<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, associate the&nbsp;<code>int_var<\/code>&nbsp;object with a widget. For example, you can associate it with an entry widget:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">quantity_entry = ttk.Entry(root, textvariable=quantity_var)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"accessing-and-changing-intvar-value\" id='accessing-and-changing-intvar-value'>Accessing and Changing IntVar Value <a href=\"#accessing-and-changing-intvar-value\" class=\"anchor\" id=\"accessing-and-changing-intvar-value\" title=\"Anchor for Accessing and Changing IntVar Value\">#<\/a><\/h3>\n\n\n\n<p>Since the&nbsp;<code>IntVar<\/code>&nbsp;object is already associated with the entry widget, you can get the current value of the entry widget using the&nbsp;<code>IntVar<\/code>&nbsp;object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">current_value = int_var.get()<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>You can also change the value of the entry widget via the&nbsp;<code>IntVar<\/code>&nbsp;object using the&nbsp;<code>set<\/code>&nbsp;function:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">int_var.set(<span class=\"hljs-number\">20<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"tracing-values\" id='tracing-values'>Tracing Values <a href=\"#tracing-values\" class=\"anchor\" id=\"tracing-values\" title=\"Anchor for Tracing Values\">#<\/a><\/h3>\n\n\n\n<p>If you want to execute a function when the value of an&nbsp;<code>IntVar<\/code>&nbsp;changes, you can use the&nbsp;<code>trace_add<\/code>&nbsp;method:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">int_var.trace_add(mode, callback)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The&nbsp;<code>trace_add()<\/code>&nbsp;method accepts two parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>mode<\/code>: Determines when the&nbsp;<code>IntVar<\/code>&nbsp;object should execute the callback function. The mode can be&nbsp;<code>'write'<\/code>,&nbsp;<code>'read'<\/code>, and&nbsp;<code>'unset'<\/code>, or a tuple of these strings. For example, if you set the mode to&nbsp;<code>'write'<\/code>, the&nbsp;<code>IntVar<\/code>&nbsp;object will execute the callback when its value changes.<\/li>\n\n\n\n<li><code>callback<\/code>: A function that the&nbsp;<code>IntVar<\/code>&nbsp;will execute according to the mode.<\/li>\n<\/ul>\n\n\n\n<p>To stop tracing, you can use the&nbsp;<code>trace_remove()<\/code>&nbsp;method:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">int_var.trace_remove(mode, callback)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The&nbsp;<code>trace_remove()<\/code>&nbsp;method removes the callback from executing for particular modes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"using-intvar-with-entry-widget\" id='using-intvar-with-entry-widgets'>Using IntVar with Entry Widgets <a href=\"#using-intvar-with-entry-widgets\" class=\"anchor\" id=\"using-intvar-with-entry-widgets\" title=\"Anchor for Using IntVar with Entry Widgets\">#<\/a><\/h2>\n\n\n\n<p>The following program shows how to use an&nbsp;<code>IntVar<\/code>&nbsp;object with the entry widget:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import<\/span> tkinter <span class=\"hljs-keyword\">as<\/span> tk\n<span class=\"hljs-keyword\">from<\/span> tkinter <span class=\"hljs-keyword\">import<\/span> ttk\n<span class=\"hljs-keyword\">from<\/span> tkinter.messagebox <span class=\"hljs-keyword\">import<\/span> showinfo\n\n\nroot = tk.Tk()\nroot.geometry(<span class=\"hljs-string\">'400x300'<\/span>)\nroot.title(<span class=\"hljs-string\">'IntVar Demo'<\/span>)\n\n\nquantity_var = tk.IntVar()\n\nlabel = ttk.Label(root, text=<span class=\"hljs-string\">'Quantity:'<\/span>)\nlabel.pack(side=tk.LEFT, padx=<span class=\"hljs-number\">5<\/span>, pady=<span class=\"hljs-number\">10<\/span>, anchor=tk.W)   \n\nquantity_entry = ttk.Entry(root, textvariable=quantity_var)\nquantity_entry.pack(side=tk.LEFT, padx=<span class=\"hljs-number\">5<\/span>, pady=<span class=\"hljs-number\">10<\/span>, anchor=tk.W)\n\n\nbutton = ttk.Button(\n    root, \n    text=<span class=\"hljs-string\">'Submit'<\/span>, \n    command=<span class=\"hljs-keyword\">lambda<\/span>: showinfo(title=<span class=\"hljs-string\">'Quantity'<\/span>, message=quantity_var.get()))\n\nbutton.pack(side=tk.LEFT, padx=<span class=\"hljs-number\">5<\/span>, pady=<span class=\"hljs-number\">10<\/span>, anchor=tk.W)\n\nroot.mainloop()<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"464\" height=\"211\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2025\/04\/tkinter-intvar-entry.gif\" alt=\"Tkinter IntVar with Entry\" class=\"wp-image-7329\"\/><\/figure>\n<\/div>\n\n\n<p>How the Program Works:<\/p>\n\n\n\n<p>First, create a new IntVar object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">quantity_var = tk.IntVar()<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Second, link the IntVar object with an Entry widget:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">entry = ttk.Entry(root, textvariable=quantity_var)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, show the value of the quantity entry via the&nbsp;<code>quantity_var<\/code>&nbsp;object when the button is clicked:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">button = ttk.Button(\n    root, \n    text=<span class=\"hljs-string\">'Submit'<\/span>, \n    command=<span class=\"hljs-keyword\">lambda<\/span>: showinfo(title=<span class=\"hljs-string\">'Quantity'<\/span>, message=quantity_var.get()))<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id=\"using-intvar-with-scale-widget\" id='using-intvar-with-scale-widgets'>Using IntVar with Scale Widgets <a href=\"#using-intvar-with-scale-widgets\" class=\"anchor\" id=\"using-intvar-with-scale-widgets\" title=\"Anchor for Using IntVar with Scale Widgets\">#<\/a><\/h2>\n\n\n\n<p>The following program shows how to use the&nbsp;<code>IntVar<\/code>&nbsp;object with a <code>Scale<\/code> widget:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">import<\/span> tkinter <span class=\"hljs-keyword\">as<\/span> tk\n<span class=\"hljs-keyword\">from<\/span> tkinter <span class=\"hljs-keyword\">import<\/span> ttk\n\n\nroot = tk.Tk()\nroot.geometry(<span class=\"hljs-string\">\"400x300\"<\/span>)\nroot.title(<span class=\"hljs-string\">\"Scale Example with IntVar and ttk\"<\/span>)\n\nint_var = tk.IntVar()\n\nscale = ttk.Scale(\n    root,\n    from_=<span class=\"hljs-number\">0<\/span>,\n    to=<span class=\"hljs-number\">100<\/span>,\n    orient=tk.HORIZONTAL,\n    variable=int_var,\n    command=<span class=\"hljs-keyword\">lambda<\/span> val: label.config(text=<span class=\"hljs-string\">f\"Scale Value: <span class=\"hljs-subst\">{int_var.get()}<\/span>\"<\/span>)\n)\nscale.pack(pady=<span class=\"hljs-number\">20<\/span>)\n\n<span class=\"hljs-comment\"># Create a Label to display the scale value<\/span>\nlabel = ttk.Label(root, text=<span class=\"hljs-string\">\"Scale Value: 0\"<\/span>)\nlabel.pack(pady=<span class=\"hljs-number\">10<\/span>)\n\nroot.mainloop()<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"466\" height=\"184\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2025\/04\/tkinter-intvar-scale.gif\" alt=\"Tkinter IntVar with Scale\" class=\"wp-image-7330\"\/><\/figure>\n<\/div>\n\n\n<p>How the Program Works:<\/p>\n\n\n\n<p>First, create a new <code>IntVar<\/code> object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">int_var = tk.IntVar()<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Second, link the <code>IntVar<\/code> object to a <code>Scale<\/code> widget:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">scale = ttk.Scale(\n    root,\n    from_=<span class=\"hljs-number\">0<\/span>,\n    to=<span class=\"hljs-number\">100<\/span>,\n    orient=tk.HORIZONTAL,\n    variable=int_var,\n    command=<span class=\"hljs-keyword\">lambda<\/span> val: label.config(text=<span class=\"hljs-string\">f\"Scale Value: <span class=\"hljs-subst\">{int_var.get()}<\/span>\"<\/span>)\n)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p>When the scale value changes, update the label by getting the current value of the scale via the&nbsp;<code>IntVar<\/code>&nbsp;object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-15\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">command=<span class=\"hljs-keyword\">lambda<\/span> val: label.config(text=<span class=\"hljs-string\">f\"Scale Value: <span class=\"hljs-subst\">{int_var.get()}<\/span>\"<\/span>)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-15\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id=\"summary\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the&nbsp;<code>IntVar<\/code>&nbsp;class to create integer variable objects.<\/li>\n\n\n\n<li>Link&nbsp;<code>IntVar<\/code>&nbsp;objects to widgets to get the integer values.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"7324\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-intvar\/\"\n\t\t\t\tdata-post-title=\"Tkinter IntVar\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"7324\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/tkinter\/tkinter-intvar\/\"\n\t\t\t\tdata-post-title=\"Tkinter IntVar\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\t\t\t<input type=\"button\" name=\"wth-submit\" class=\"wth-btn wth-btn-submit\" id=\"wth-submit\" \/>\n\t\t\t<input type=\"button\" class=\"wth-btn wth-btn-cancel\" value=\"Cancel\" \/>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summary: In this tutorial, you&#8217;ll learn how to link widgets with Python variables using the Tkinter IntVar objects. Introduction to the Tkinter IntVar # In Tkinter, the&nbsp;IntVar&nbsp;class allows you to create integer variable objects. An&nbsp;IntVar&nbsp;object holds an integer value. Tkinter links an&nbsp;IntVar&nbsp;object with a widget, such as an entry, checkbox, or radio button. By using&nbsp;IntVar&nbsp;objects, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1232,"menu_order":49,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-7324","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/7324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/comments?post=7324"}],"version-history":[{"count":5,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/7324\/revisions"}],"predecessor-version":[{"id":7340,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/7324\/revisions\/7340"}],"up":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/1232"}],"wp:attachment":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/media?parent=7324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}