0% found this document useful (0 votes)
36 views17 pages

Mini Project 23e23e

The document summarizes a text editor project created by students in Python. It includes 5 students' names, their professor's names, an introduction explaining what a text editor is, the features and functions of the text editor created in Python like opening, saving and editing files. It also includes screenshots and source code for the text editor application.

Uploaded by

pushpendra82183
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views17 pages

Mini Project 23e23e

The document summarizes a text editor project created by students in Python. It includes 5 students' names, their professor's names, an introduction explaining what a text editor is, the features and functions of the text editor created in Python like opening, saving and editing files. It also includes screenshots and source code for the text editor application.

Uploaded by

pushpendra82183
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

TEXT EDITOR

Submitted by :
Lavish Kumar 2104710100026
Gaurav Rawat 2104710100016
Chaudhary Alisha 2104710100014
Shubham Singh 2104710100055
Harsh Varlani 2104710100021

Under the supervision of:


Assi. Pro. Pawan Yadav sir
Assi. Pro. Stu Bhardwaj

Department Of Computer Science


Eshan College Of Engineering, Farah Mathura
ACKNOWLEDGEMENT
We are pleased to acknowledgement Prof. Stu Bhardwaj
Mam and Prof. Pawan Yadav Sir for their invaluable
guidance during the course of this project work.

We extend our sincere thanks to Pramod Sir who


connuously helped us throughout the project and
without his guidance, this project would have been an
uphill task.

Lavish Kumar 2104710100026


Gaurav Rawat 2104710100016
Chaudhary Alisha 2104710100014
Shubham Singh 2104710100055
Harsh Varlani 2104710100021
INTRODUCTION

The Project is based on “TEXT EDITOR”.


TEXT EDITOR - A text editor is a type of program used for
editing plain text files. A text editor is a tool that allows a
user to create and revise documents on a computer.
In other words, this refers to any form of computer
program that enables users to create, edit, open, view, and
save plain text files.
They come already installed on most operating systems
but their dominant application has evolved from
notetaking and creating documents to creating complex
code.
ABSTRACT

The application is a text editor in Python. This text editor


developed in the Python platform is a replication of
Notepad.
We all are familiar with and which we use quite often on a
daily basis. The only difference being dad.
This editor has been created using Python for the front-air
interface.
This report is for the detailed study done by us to learn
Python by developing Notepad. This application contains
some basic features like Open files, new files, save files,
edit files, cut text, copy text, paste text, etc.
Project Overview

Project Name: Text Editor

Project Type: Development Project


(Mini project)

Language: Python

Software used: Notepad, PyCharm.

Basic Explanation
Text Editor: A text editor is a type of program used
for editing ng plain text file. They’re often used to create
complex code for websites; read, create, and edit source
code; or build text files.

Features of Text Editor


Copy, paste, and cut, along with finding and replacing
words and creating bulleted lists, are typical across text
editor platforms.
Search and replace looks for a specific text string and
replace it with another line.
Ver cal selec on editing enables users to simultaneously
select, edit, format, or add to multiple lines of code.
A customizable interface helps the user customize the
appearance and layout of the editor. Users can choose
their desired font and color theme and make the interface
more personalized.

Python Programming Language: Python is a high-


level, general-purpose programming language. Its design
philosophy emphasizes code readability with the use of
significant indenta on.

Python is dynamically typed and garbage-collected. It


supports multiple programming paradigms, including
structured (particularly procedural), object-oriented, and
functional programming. It is often described as a
"bareries included" language due to its comprehensive
standard library.

Guido van Rossum began working on Python in the late


1980s as a successor to the ABC programming language
and first released it in 1991 as Python 0.9.0. Python 2.0
was released in 2000. Python 3.0, released in 2008, was a
major revision not completely backward-compatable with
earlier versions. Python 2.7.18, released in 2020, was the
last release of Python 2.

Python consistently ranks as one of the most popular


programming languages.

Software Used:
Notepad: Notepad is a generic text editor included with
all versions of Microsoft Windows that lets you create,
open, and read plaintext files with a .txt file extension. If
the file contains special formatting or is not a plaintext
file, it cannot be read in Notepad. The image shown here
is a small example of what the Notepad may look like
while running.

PyCharm: PyCharm is an integrated development


environment (IDE) used for programming in Python.
It provides code analysis, a graphical debugger, an
integrated unit tester, integra on with version control
systems, and supports web development
with Django. PyCharm is developed by
the Czech company JetBrains.[4]
It is cross-pla orm, working on Microso
Windows, macOS and Linux. PyCharm has a Professional
Edi on, released under a proprietary license and a
Community Edi on released under the Apache License.[5]
PyCharm Community Edi on is less extensive than the
Professional Edi on.
Source Code for Text Editor
from tkinter import *
from tkinter.filedialog import askopenfilename, asksaveasfilename
from tkinter import messagebox

window = Tk() window.


tle("[email protected]")
theme_bu on = Bu on(window, text="Change Theme", command='') theme_bu
on.pack()

text_editor = Text(window, wrap=WORD)


text_editor.pack(fill="both", expand=True)

# Create a theme variable and set the default theme to Light


theme_var = StringVar(value="Light")
theme_bu on = Bu on(window, text="Change Theme") theme_bu
on.pack()
# file func onality usage def
new_file():
text_editor.delete(0.0, END)
def open_file():
filepath = askopenfilename(filetypes=[("Text file", "*.txt"), ("all file",
"*.*")]) if not filepath:
return
text_editor.delete("1.0", END) with open(filepath,
mode='r', encoding='u -8') as input_file:
text = input_file.read()
text_editor.insert(END, text)
window. tle(f'simple text editor - {filepath}') def
save_file():
filepath = asksaveasfilename(defaultextension='.txt', filetypes=[("Text file",
"*.txt"), ("all file", "*.*")])
if not filepath:
return with open(filepath, mode='w', encoding='u -8') as
output_file:
text = text_editor.get('1.0', END)
output_file.write(text)
window. tle(f'simple text editor - {filepath}') def
exit_file():
if text_editor.edit_modified():
result = messagebox.askyesnocancel('warning', 'do you want to save this file?')
print(result)
# edit func onality usage def
cut_text():
text = text_editor.get("sel.first", "sel.last")
text_editor.delete("sel.first", "sel.last")
window.clipboard_clear()
window.clipboard_append(text) def
copy_text():
text = text_editor.get("sel.first", "sel.last")
window.clipboard_clear()
window.clipboard_append(text) def
paste_text():
text = window.clipboard_get()
text_editor.insert("insert", text)

def delete_text():
text_editor.delete("sel.first", "sel.last")

def change_theme():
current_theme = theme_var.get() if
current_theme == "Light":
text_editor.config(bg="white", fg="black")
theme_var.set("Dark") else:
text_editor.config(bg="black", fg="white")
theme_var.set("Light")

menu = Menu(window) window.config(menu=menu)


# file menu sec on............... filemenu
= Menu(menu)
menu.add_cascade(label='file', menu=filemenu)
filemenu.add_command(label='new', accelerator='ctrl+N', command=new_file)
filemenu.add_command(label='open', accelerator='ctrl+o', command=open_file)
filemenu.add_command(label='save as....', accelerator='ctrl+s',
command=save_file) filemenu.add_separator()
filemenu.add_command(label='exit', command=exit_file)

# edit menu sec on............... editmenu


= Menu(menu)
menu.add_cascade(label='edit', menu=editmenu)
editmenu.add_command(label='cut', command=cut_text)
editmenu.add_command(label='copy', command=copy_text)
editmenu.add_command(label='paste', command=paste_text)
editmenu.add_command(label='find') editmenu.add_separator()
editmenu.add_command(label="delete", command=delete_text)
# view menu sec on viewmenu
= Menu(menu)
menu.add_cascade(label='view', menu=viewmenu)
viewmenu.add_command(label='translate')

# theme menu sec on thememenu =


Menu(menu)
menu.add_cascade(label='theme', menu=thememenu)
thememenu.add_command(label='change theme',command=change_theme)

change_theme() window.mainloop()

Snapshots:

You might also like