DEV Community

rrtutors
rrtutors

Posted on • Originally published at rrtutors.com

Create Notepad editor with Python using Tkinter

Develop a Notepad editor with Tkinter .Tkinter is Python GUI toolkit which will provide GUI interface. To create this notepad editor we need to add Tkinter library. This Project contains functionalities like

Create new File
Open new File
Save File
Exit Editor
Cut, Copy and Past functionalities

Python Notepad application

How to install Tkinter library?

To install Tkinter we need pre installed python, when we install python we need to check td/tk and IDLE checkbox which will install Tkinter library.

If we missed it while install python we can install Tkinter separately by run the pip command.

This Tkinter can be installed by pip, we need to run below command

pip install python-tk
Enter fullscreen mode Exit fullscreen mode

This will download and install all required packages for Tkinter

Now create python project and import required packages

import os
from tkinter import *
from tkinter.messagebox import *
from tkinter.filedialog import *


class Notepad:
    __root = Tk()
Enter fullscreen mode Exit fullscreen mode

Here we have imported two other packages called messagebox and filedialog

MessageBox is used to show white box to write the content

Filedialog is used to show dialog with options when we tap on menu options

Download complete python notepadd application project source code

Discussion (1)

Collapse
limitcracker profile image
Ioannis Gyftakis

Hi, how we could also add a Python Terminal in a frame of our tkinter app in order to start looking more of a coding editor?