Build Your Own Notepad With Python
In this tutorial, i will explain you how to create your own Notepad using python and for making this Notepad projects i am using very simple python coding( Only using tkinter module for this project ).
Source Code :-
****************************************************************************
from tkinter import *
from tkinter.filedialog import *
win = Tk()
win.geometry('400x570')
win.title('Notepad')
def openfile():
file = askopenfile(mode='r',filetypes=[('filename','*.txt')])
if file is not None:
content = file.read()
text.insert(INSERT,content)
def savefile():
new_file = asksaveasfile(mode='w',filetypes=[('filename','.txt')])
if new_file is None:
return
text1 = text.get(1.0,END)
new_file.write(text1)
new_file.close()
def clearfile():
text.delete(1.0,END)
text = Text(win,font='impack 15 bold',bg='yellow',wrap=WORD)
text.pack(padx=10,pady=40)
Button(win,text='Open',font='poppins 15 bold',bg='blue',fg='white',bd=0,cursor='hand2',command=openfile).place(x=50,y=530)
Button(win,text='Save',font='poppins 15 bold',bg='green',fg='white',bd=0,cursor='hand2',command=savefile).place(x=130,y=530)
Button(win,text='Clear',font='poppins 15 bold',bg='purple',fg='white',bd=0,cursor='hand2',command=clearfile).place(x=210,y=530)
Button(win,text='Exit',font='poppins 15 bold',bg='red',fg='white',bd=0,cursor='hand2',command=lambda :exit()).place(x=290,y=530)
mainloop()
****************************************************************************
#python
#notepad
#pythonprojects
#pythonforbeginners
#pythoninhindi
#learnpython
#pythonprojectsforresume
#pythonprogramming
#pythonstation
#createnotepadwithpython
#pythonprojectsinhindi
On this page of the site you can watch the video online Build Your Own Notepad With Python with a duration of hours minute second in good quality, which was uploaded by the user Python Station 28 July 2022, share the link with friends and acquaintances, this video has already been watched 402 times on youtube and it was liked by 26 viewers. Enjoy your viewing!