{"id":18861,"date":"2022-09-24T13:16:25","date_gmt":"2022-09-24T07:46:25","guid":{"rendered":"https:\/\/copyassignment.com\/?p=18861"},"modified":"2022-12-02T13:46:09","modified_gmt":"2022-12-02T08:16:09","slug":"drawing-application-in-python-tkinter","status":"publish","type":"post","link":"https:\/\/copyassignment.com\/drawing-application-in-python-tkinter\/","title":{"rendered":"Drawing Application in Python Tkinter"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>In this article, we will design and construct a basic Drawing Application in Python Tkinter GUI, where we can simply draw something on the canvas using a <strong>pencil<\/strong> and erase it with an <strong>eraser<\/strong>, as well as the ability to change the <strong>thickness of a pencil and eraser<\/strong>. We may also modify the <strong>canvas&#8217;s background color<\/strong> and <strong>save<\/strong> a specific drawing on our local computer. So let&#8217;s get started and create this amazing drawing application in Python. You can find the complete source code <a href=\"#complete-code\">here<\/a>.<\/p>\n\n\n\n<p><strong>Before Starting coding, check this video to know what we are going to make:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-rich is-provider-embed-handler wp-block-embed-embed-handler\"><div class=\"wp-block-embed__wrapper\">\n<div style=\"width: 640px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-18861-1\" width=\"640\" height=\"360\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/drawing-application-in-python-1-1.mp4?_=1\" \/><a href=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/drawing-application-in-python-1-1.mp4\">https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/drawing-application-in-python-1-1.mp4<\/a><\/video><\/div>\n<\/div><\/figure>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-9886351916045880\" data-ad-slot=\"2002566052\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Steps for creating Paint or Drawing Application in Python Tkinter<\/h2>\n\n\n\n<h3 class=\"has-medium-font-size wp-block-heading\">Step 1: Create a Python file with .py extension and import all the necessary libraries<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>from tkinter import *\nfrom tkinter.ttk import Scale\nfrom tkinter import colorchooser,filedialog,messagebox\nimport PIL.ImageGrab as ImageGrab\n<\/code><\/pre>\n\n\n\n<p>Tkinter is a Python package for creating graphical user interfaces. It&#8217;s simple to use and comes packaged with Python. We can use GUI applications to visualize our data. <strong>PIL.ImageGrab <\/strong>package is used to save the image file on our local computer.<\/p>\n\n\n\n<p>Before importing all the packages it is required to install them in our working directories. For this particular project, we need to install <strong>Tkinter<\/strong> and <strong>pillow<\/strong> packages. You can install these packages using the <strong>pip command<\/strong> in your terminal.<\/p>\n\n\n\n<p><strong>Command to install Tkinter :<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>pip install tk<\/strong><\/pre>\n\n\n\n<p><strong>Command to install pillow:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>pip install pillow<\/strong><\/pre>\n\n\n\n<p>This command will begin downloading and installing Tkinter-related packages. Once completed, a notification indicating successful installation will display.<\/p>\n\n\n\n<h3 class=\"has-medium-font-size wp-block-heading\">Step 2: Defining a Class and Creating a Tkinter Window GUI<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>class Draw():\n    def __init__(self,root):\n        self.root =root\n        self.root.title(\"Copy Assignment Painter\")\n        self.root.geometry(\"810x530\")\n        self.root.configure(background=\"white\")\n        self.root.resizable(0,0)\n<\/code><\/pre>\n\n\n\n<p>Now we will create a class having the class name Draw() and define __init__. After that, we can call Tkinter Constructor but for this particular application, we have called root as a constructor.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>self.root.title : <\/strong>To define the title of our GUI Application.<\/li>\n\n\n\n<li><strong>self.root.geometry : <\/strong>To define the size of the Window.<\/li>\n\n\n\n<li><strong>self.root.resizable(0,0) : <\/strong>By using this property we cannot increase or decrease the size of the root window.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>if __name__ ==\"__main__\":\n    root = Tk()\n    p= Draw(root)\n    root.mainloop()\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>root.mainloop() <\/strong>is used for holding the GUI of our Application.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"has-medium-font-size wp-block-heading\">Step 3: Creating Widgets for our Tkinter Window<\/h3>\n\n\n\n<p><strong>1. Code for the color Panel(on left side of drawing application in tkinter):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Pick a color for drawing from color pannel\n        self.pick_color = LabelFrame(self.root,text='Colors',font =('arial',15),bd=5,relief=RIDGE,bg=\"white\")\n        self.pick_color.place(x=0,y=40,width=90,height=185)\n\n        colors = &#091;'blue','red','green', 'orange','violet','black','yellow','purple','pink','gold','brown','indigo']\n        i=j=0\n        for color in colors:\n            Button(self.pick_color,bg=color,bd=2,relief=RIDGE,width=3,command=lambda col=color:self.select_color(col)).grid(row=i,column=j)\n            i+=1\n            if i==6:\n                i=0\n                j=1\n<\/code><\/pre>\n\n\n\n<p>We have initialized <strong>pick_color <\/strong>as our <strong>LabelFrame <\/strong>and placed it on the root. After that, we can define various attributes such as text, color, background color, height, width, ridge, and many more according to our requirements.<\/p>\n\n\n\n<p>We can define the colors required for painting using Lists. For each and every color palette we will create a button using a <strong>for loop<\/strong> where <strong>(i = row and j= column).&nbsp;&nbsp;<\/strong><\/p>\n\n\n\n<p>When the user clicks on the color button then it will execute the following command: <strong>command=lambda col=color:self.select_color(col).<\/strong><\/p>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-9886351916045880\" data-ad-slot=\"2002566052\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p><strong>2. Code for Eraser, Reset, Background Color, and Save buttons(left side options in drawing app in Python):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Erase Button and its properties  \n        self.eraser_btn= Button(self.root,text=\"Eraser\",bd=4,bg='white',command=self.eraser,width=9,relief=RIDGE)\n        self.eraser_btn.place(x=0,y=197)\n \n# Reset Button to clear the entire screen\n        self.clear_screen= Button(self.root,text=\"Clear Screen\",bd=4,bg='white',command= lambda : self.background.delete('all'),width=9,relief=RIDGE)\n        self.clear_screen.place(x=0,y=227)\n \n# Save Button for saving the image in local computer\n        self.save_btn= Button(self.root,text=\"ScreenShot\",bd=4,bg='white',command=self.save_drawing,width=9,relief=RIDGE)\n        self.save_btn.place(x=0,y=257)\n \n# Background Button for choosing color of the Canvas\n        self.bg_btn= Button(self.root,text=\"Background\",bd=4,bg='white',command=self.canvas_color,width=9,relief=RIDGE)\n        self.bg_btn.place(x=0,y=287)\n<\/code><\/pre>\n\n\n\n<p>When a user clicks on the buttons then the following functions will be called.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>self.eraser_btn : <strong>command=self.eraser<\/strong><\/li>\n\n\n\n<li>self.clear_screen : command=<strong> lambda : self.background.delete(&#8216;all&#8217;)<\/strong><\/li>\n\n\n\n<li>self.save_btn : command=<strong>self.save_drawing<\/strong><\/li>\n\n\n\n<li>self.bg_btn : command=<strong>self.canvas_color<\/strong><\/li>\n<\/ul>\n\n\n\n<p><strong>3. Code for creating a Scale for Pen(Pointer) and Eraser:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        self.pointer_frame= LabelFrame(self.root,text='size',bd=5,bg='white',font=('arial',15,'bold'),relief=RIDGE)\n        self.pointer_frame.place(x=0,y=320,height=200,width=70)\n \n        self.pointer_size =Scale(self.pointer_frame,orient=VERTICAL,from_ =48 , to =0, length=168)\n        self.pointer_size.set(1)\n        self.pointer_size.grid(row=0,column=1,padx=15)\n<\/code><\/pre>\n\n\n\n<p>For this application we are using ttk scale bar so we need to import this from Tkinter using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from tkinter.ttk import Scale<\/code><\/pre>\n\n\n\n<p>After that, we initialize <strong>pointer_size<\/strong> to <strong>Scale<\/strong> and place it on <strong>pointer_frame<\/strong>. Here we need to define <strong>orient = VERTICAL <\/strong>as by default the orientation is horizontal. The default value is set to 1 using <strong>self.pointer_size.set(1) <\/strong>command.<\/p>\n\n\n\n<p><strong>4. Code for Creating the Canvas<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#Defining a background color for the Canvas\n        self.background = Canvas(self.root,bg='white',bd=5,relief=GROOVE,height=470,width=680)\n        self.background.place(x=80,y=40)\n \n \n#Bind the background Canvas with mouse click\n        self.background.bind(\"&lt;B1-Motion&gt;\",self.paint)\n<\/code><\/pre>\n\n\n\n<p>Here, <strong>self.background<\/strong> has been set to Canvas and placed on <strong>self.root<\/strong>. Then a canvas would be made, but we couldn&#8217;t draw anything on it. Therefore, in order to achieve that goal, the following code must be used: <strong>self.background.bind(&#8220;B1-Motion&gt;&#8221;,self.paint)<\/strong>.<\/p>\n\n\n\n<h3 class=\"has-medium-font-size wp-block-heading\">Step 4: Defining Functions for GUI Drawing Application Program<\/h3>\n\n\n\n<p>1. <strong>Function for Drawing the lines on Canvas<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def paint(self,event):      \n        x1,y1 = (event.x-2), (event.y-2)  \n        x2,y2 = (event.x+2), (event.y+2)  \n<\/code><\/pre>\n\n\n\n<p>Here is where the paint function that is invoked during binding is defined.<\/p>\n\n\n\n<p>Four variables are declared and designated as x1, y1, x2, and y2 in this function, defining the starting point and ending position of the mouse movement.<\/p>\n\n\n\n<p><strong>2. Function for choosing the color of pointer<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def select_color(self,col):\n        self.pointer = col\n<\/code><\/pre>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-9886351916045880\" data-ad-slot=\"2002566052\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p>The pointer&#8217;s default color is black, but once the <strong>select_color<\/strong> function is defined and the<strong> self.pointer<\/strong> is initialized to the <strong>col<\/strong>, the default color is changed to the chosen color.<\/p>\n\n\n\n<p><strong>3. Function for defining the eraser<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def eraser(self):\n        self.pointer= self.erase<\/code><\/pre>\n\n\n\n<p>4. <strong>Function for choosing the background color of the Canvas<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def canvas_color(self):\n        color=colorchooser.askcolor()\n        self.background.configure(background=color&#091;1])\n        self.erase= color&#091;1]\n<\/code><\/pre>\n\n\n\n<p>Now for choosing the background color of Canvas we need to import using<\/p>\n\n\n\n<p><strong><code>from tkinter import colorchooser<\/code><\/strong> command<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>color=colorchooser.askcolor(): <\/strong>&nbsp;This code will open up a dialog box for choosing a wide range of colors for the background of Canvas.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>self.background.configure(background=color[1]) : <\/strong>This code will change the background color of Canvas from default color to chosen color.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>self.erase= color[1]<\/strong>: &nbsp;This code will change the color of the eraser from the default color to chosen color.<\/li>\n<\/ul>\n\n\n\n<p><strong>5. Function for saving the image file in Local Computer:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def save_drawing(self):\n        try:\n            # self.background update()\n            file_ss =filedialog.asksaveasfilename(defaultextension='jpg')\n            print(file_ss)\n            x=self.root.winfo_rootx() + self.background.winfo_x()\n            print(x, self.background.winfo_x())\n            y=self.root.winfo_rooty() + self.background.winfo_y()\n            print(y)\n \n            x1= x + self.background.winfo_width()\n            print(x1)\n            y1= y + self.background.winfo_height()\n            print(y1)\n            ImageGrab.grab().crop((x , y, x1, y1)).save(file_ss)\n            messagebox.showinfo('Screenshot Successfully Saved as' + str(file_ss))\n \n        except:\n            print(\"Error in saving the screenshot\")\n<\/code><\/pre>\n\n\n\n<p>Now to save the image file we need to import using the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>from tkinter import filedialog,messagebox<\/strong><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>import PIL.ImageGrab as ImageGrab<\/strong><\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>filedialog.asksaveasfilename(defaultextension=&#8217;jpg&#8217;) : <\/strong>&nbsp;This code will keep the default extension of the file as <strong>.jpg<\/strong> format for saving.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>self.root.winfo_rootx() + self.background.winfo_x()<\/strong>: This code will return the info root window with respect to the x-axis.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>self.root.winfo_rooty() + self.background.winfo_y():<\/strong> This code will return the info root window with respect to the y-axis.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>x + self.background.winfo_width(): <\/strong>This code will return the width of the window.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>y + self.background.winfo_height(): <\/strong>&nbsp;This code will return the height of the window.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ImageGrab.grab().crop((x , y, x1, y1)).save(file_ss): <\/strong>This code will save the image file to the local computer.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"complete-code\">Complete Source code for Paint or Drawing Application in Python Tkinter<\/h2>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-9886351916045880\" data-ad-slot=\"2002566052\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><div style=\"position:absolute;top:-20px;right:0px;cursor:pointer\" class=\"copy-simple-code-block\"><span class=\"dashicon dashicons dashicons-admin-page\"><\/span><\/div><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"python\" data-theme=\"xcode\" data-fontsize=\"14\" data-lines=\"Infinity\" data-showlines=\"true\" data-copy=\"true\"># Drawing Application Using Python\n\n#importing all the necessary Libraries\n\nfrom tkinter import *\nfrom tkinter.ttk import Scale\nfrom tkinter import colorchooser,filedialog,messagebox\nimport PIL.ImageGrab as ImageGrab\n\n\n#Defining Class and constructor of the Program\nclass Draw():\n    def __init__(self,root):\n\n#Defining title and Size of the Tkinter Window GUI\n        self.root =root\n        self.root.title(\"Copy Assignment Painter\")\n#         self.root.geometry(\"810x530\")\n        self.root.configure(background=\"white\")\n#         self.root.resizable(0,0)\n \n#variables for pointer and Eraser   \n        self.pointer= \"black\"\n        self.erase=\"white\"\n\n#Widgets for Tkinter Window\n    \n# Configure the alignment , font size and color of the text\n        text=Text(root)\n        text.tag_configure(\"tag_name\", justify='center', font=('arial',25),background='#292826',foreground='orange')\n\n# Insert a Text\n        text.insert(\"1.0\", \"Drawing Application in Python\")\n\n# Add the tag for following given text\n        text.tag_add(\"tag_name\", \"1.0\", \"end\")\n        text.pack()\n        \n# Pick a color for drawing from color pannel\n        self.pick_color = LabelFrame(self.root,text='Colors',font =('arial',15),bd=5,relief=RIDGE,bg=\"white\")\n        self.pick_color.place(x=0,y=40,width=90,height=185)\n\n        colors = ['blue','red','green', 'orange','violet','black','yellow','purple','pink','gold','brown','indigo']\n        i=j=0\n        for color in colors:\n            Button(self.pick_color,bg=color,bd=2,relief=RIDGE,width=3,command=lambda col=color:self.select_color(col)).grid(row=i,column=j)\n            i+=1\n            if i==6:\n                i=0\n                j=1\n\n # Erase Button and its properties   \n        self.eraser_btn= Button(self.root,text=\"Eraser\",bd=4,bg='white',command=self.eraser,width=9,relief=RIDGE)\n        self.eraser_btn.place(x=0,y=197)\n\n# Reset Button to clear the entire screen \n        self.clear_screen= Button(self.root,text=\"Clear Screen\",bd=4,bg='white',command= lambda : self.background.delete('all'),width=9,relief=RIDGE)\n        self.clear_screen.place(x=0,y=227)\n\n# Save Button for saving the image in local computer\n        self.save_btn= Button(self.root,text=\"ScreenShot\",bd=4,bg='white',command=self.save_drawing,width=9,relief=RIDGE)\n        self.save_btn.place(x=0,y=257)\n\n# Background Button for choosing color of the Canvas\n        self.bg_btn= Button(self.root,text=\"Background\",bd=4,bg='white',command=self.canvas_color,width=9,relief=RIDGE)\n        self.bg_btn.place(x=0,y=287)\n\n\n#Creating a Scale for pointer and eraser size\n        self.pointer_frame= LabelFrame(self.root,text='size',bd=5,bg='white',font=('arial',15,'bold'),relief=RIDGE)\n        self.pointer_frame.place(x=0,y=320,height=200,width=70)\n\n        self.pointer_size =Scale(self.pointer_frame,orient=VERTICAL,from_ =48 , to =0, length=168)\n        self.pointer_size.set(1)\n        self.pointer_size.grid(row=0,column=1,padx=15)\n\n\n#Defining a background color for the Canvas \n        self.background = Canvas(self.root,bg='white',bd=5,relief=GROOVE,height=470,width=680)\n        self.background.place(x=80,y=40)\n\n\n#Bind the background Canvas with mouse click\n        self.background.bind(\"&lt;B1-Motion>\",self.paint) \n\n\n# Functions are defined here\n\n# Paint Function for Drawing the lines on Canvas\n    def paint(self,event):       \n        x1,y1 = (event.x-2), (event.y-2)  \n        x2,y2 = (event.x+2), (event.y+2)  \n\n        self.background.create_oval(x1,y1,x2,y2,fill=self.pointer,outline=self.pointer,width=self.pointer_size.get())\n\n# Function for choosing the color of pointer  \n    def select_color(self,col):\n        self.pointer = col\n\n# Function for defining the eraser\n    def eraser(self):\n        self.pointer= self.erase\n\n# Function for choosing the background color of the Canvas    \n    def canvas_color(self):\n        color=colorchooser.askcolor()\n        self.background.configure(background=color[1])\n        self.erase= color[1]\n\n# Function for saving the image file in Local Computer\n    def save_drawing(self):\n        try:\n            # self.background update()\n            file_ss =filedialog.asksaveasfilename(defaultextension='jpg')\n            #print(file_ss)\n            x=self.root.winfo_rootx() + self.background.winfo_x()\n            #print(x, self.background.winfo_x())\n            y=self.root.winfo_rooty() + self.background.winfo_y()\n            #print(y)\n\n            x1= x + self.background.winfo_width() \n            #print(x1)\n            y1= y + self.background.winfo_height()\n            #print(y1)\n            ImageGrab.grab().crop((x , y, x1, y1)).save(file_ss)\n            messagebox.showinfo('Screenshot Successfully Saved as' + str(file_ss))\n\n        except:\n            print(\"Error in saving the screenshot\")\n\nif __name__ ==\"__main__\":\n    root = Tk()\n    p= Draw(root)\n    root.mainloop()<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Output:<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/lh5.googleusercontent.com\/_jocPbmYID0uO2lm71Ocf4z_UigJBxq02MF8CM7C-Z3Mzp7Zk25ZQ1NHj-pDix11z187fLCV0_J0siZHDtJk0nY6Kxk91A2TnLa6jCzu1AIwSF3qoCU9mhVLITxBxfFIDbwuyI7yW-xEPxXL3r6oKEYZYhC9evwsmYdROdtWL9PhAGWH2iA\" alt=\"Output 1 for Drawing Application in Python Tkinter\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/lh6.googleusercontent.com\/-p6iHtla9iWUHGN9R5b1XfQ8UswwZg5Q9hwp5E9QfNy6O16siM-zMcydZkcC6Nr2XPJkd3i_FJdpzJgj7jiP1of15Uw7mMSZ8HjUYkCH6NL_II19vyye_nKqS8ErMn0xi2bmOjy0y6vrIPAEv0Bv7AGmXmqmbE2rqJl8uVNfO2j9ha95xls\" alt=\"Output 2 for Drawing Application Program in Python Tkinter\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/><\/figure>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-9886351916045880\" data-ad-slot=\"2002566052\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/lh6.googleusercontent.com\/TFaoIEQ90CeJ1InEKUPvgCx7D2BZ2T1RHEvCXJTvkwRyhiXAnyc6AIjbCiAtXNxd1JPYHh5M0A2Z82NJjy6vQsvEJ0E5mASIRx_WSJSDOUMNkrmqPMW8HMXccgYkwK3OaI6BYeDk-mM4dIyatJL8RMzvTWPbORvJwwxjJdBHZSlkyCF3dK0\" alt=\"Output 3 for GUI Drawing Application in Python Tkinter\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>We used Tkinter to build a fantastic paint or drawing application in Python with a very user-friendly graphical user interface. Therefore, you can start here if you&#8217;re a beginner and wish to learn about or develop a project in Python. You can now make your own applications using this project.&nbsp; Share this with your friends and coworkers. You are free to run your code right away to check how it functions.<\/p>\n\n\n\n<div style=\"text-align:center\" class=\"wp-block-atomic-blocks-ab-button ab-block-button\"><a href=\"https:\/\/copyassignment.com\/top-100-python-projects-with-source-code\/\" class=\"ab-button ab-button-shape-rounded ab-button-size-medium\" style=\"color:#ffffff;background-color:#3373dc\">Best 100+ Python Projects with source code<\/a><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Also Read:<\/strong><\/p>\n\n\n<ul class=\"wp-block-latest-posts__list is-grid columns-3 wp-block-latest-posts\"><li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/create-your-own-chatgpt-with-python\/\">Create your own ChatGPT with\u00a0Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/sqlite-crud-operations-in-python\/\">SQLite | CRUD Operations in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/event-management-system-project-in-python\/\">Event Management System Project in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/ticket-booking-and-management-in-python\/\">Ticket Booking and Management in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/radha-krishna-using-python-turtle\/\">Radha Krishna using Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/hostel-management-system-project-in-python\/\">Hostel Management System Project in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/sales-management-system-project-in-python\/\">Sales Management System Project in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/bank-management-system-project-in-cpp\/\">Bank Management System Project in C++<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/python-download-file-from-url-4-methods\/\">Python Download File from URL | 4 Methods<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/python-programming-examples-fundamental-programs-in-python\/\">Python Programming Examples | Fundamental Programs in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/drawing-letter-a-using-python-turtle\/\">Drawing letter A using Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/spell-checker-in-python\/\">Spell Checker in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/portfolio-management-system-in-python\/\">Portfolio Management System in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/stickman-game-in-python\/\">Stickman Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/contact-book-project-in-python\/\">Contact Book project in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/loan-management-system-project-in-python\/\">Loan Management System Project in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/cab-booking-system-in-python\/\">Cab Booking System in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/brick-breaker-game-in-python\/\">Brick Breaker Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/wishing-happy-new-year-2023-in-python-turtle\/\">Wishing Happy New Year 2023 in Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/tank-game-in-python\/\">Tank game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/gui-piano-in-python\/\">GUI Piano in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/ludo-game-in-python\/\">Ludo Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/rock-paper-scissors-game-in-python\/\">Rock Paper Scissors Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/snake-and-ladder-game-in-python\/\">Snake and Ladder Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/puzzle-game-in-python\/\">Puzzle Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/draw-goku-in-python-turtle\/\">Draw Goku in Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/medical-store-management-system-project-in-python\/\">Medical Store Management System Project in\u00a0Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/draw-mickey-mouse-in-python-turtle\/\">Draw Mickey Mouse in Python Turtle<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/creating-dino-game-in-python\/\">Creating Dino Game in Python<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/tic-tac-toe-game-in-python\/\">Tic Tac Toe Game in Python<\/a><\/li>\n<\/ul>\n\n\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-9886351916045880\"\n     crossorigin=\"anonymous\"><\/script>\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-format=\"autorelaxed\"\n     data-ad-client=\"ca-pub-9886351916045880\"\n     data-ad-slot=\"7933252109\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this article, we will design and construct a basic Drawing Application in Python Tkinter GUI, where we can simply draw something on the&#8230;<\/p>\n","protected":false},"author":62,"featured_media":18874,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,1475,1060,1896,1061,1403,1067],"tags":[],"class_list":["post-18861","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-allcategorites","category-final-year-project","category-game-in-python","category-general-python","category-gui-python-projects","category-python-projects","category-python-turtle","wpcat-22-id","wpcat-1475-id","wpcat-1060-id","wpcat-1896-id","wpcat-1061-id","wpcat-1403-id","wpcat-1067-id"],"_links":{"self":[{"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/posts\/18861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/users\/62"}],"replies":[{"embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/comments?post=18861"}],"version-history":[{"count":0,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/posts\/18861\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/media\/18874"}],"wp:attachment":[{"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/media?parent=18861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/categories?post=18861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/tags?post=18861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}