B.tech It Batchno 103
B.tech It Batchno 103
at
Sathyabama Institute of Science and Technology
(Deemed to be University)
Information Technology
By
K.SOWNDHARYA
(Reg.No.37120073)
SATHYABAMA
INSTITUTE OF SCIENCE AND TECHNOLOGY
(DEEMED TO BE UNIVERSITY)
Accredited with Grade “A” by NAAC
JEPPIAAR NAGAR, RAJIV GANDHI SALAI, CHENNAI - 600 119
DECEMBER 2020
SATHYABAMA INSTITUTE OF SCIENCE AND TECHNOLOGY
BONAFIDE CERTIFICATE
Internal Guide
Dr.R.M.GOMATHI, M.TECH.,Ph.D.
ii
DECLARATION
DATE:
iv
ACKNOWLEDGEMENT
I would like to express my sincere and deep sense of gratitude to my Project Guide
Dr.R.M.Gomathi, M.TECH.,Ph.D. for his valuable guidance, suggestions and
constant encouragement paved way for the successful completion of my project
work.
I wish to express my thanks to all Teaching and Non-teaching staff members of the
Department of Information Technology who were helpful in many ways for the
completion of the project.
iv
iv
ABSTRACT
The project titled Text Editor using python Tkinter. Tkinter is a GUI library from python from
which can create multiple GUI apps. Here, using tkinter lt develop a notepad like text editor.
This notepad will have the menu where can able to create new file, open existing file, save
the file, editing, cut and paste, all functionality will there python installed. Text Editor GUI
using Python Text editor is an application like notepad to write documents and other files.
The text editor is made using python using Tkinter GUI interface. It offers various text editor
features such as Functions similar to any other plain text editors, Shows Line Number,
Highlights the current line, Shows cursor location at the bottom, open, close,create and edit
files. The application is built using python library Tkinter. Forcreating graphic user interface
(GUI) on Python we need to use Tkinter library. It also having different packages and
approaches for creating GUI like QT for Software Development and Django, Flask for Web
app development. Here used Tkinter because it provides a very quick and easy way.
vii
TABLE OF CONTENTS
INTRODUCTION
3.1 MODULES 7
3.2 INPUT DESIGN 8
3.3 DATA FLOW DIAGRAM 10
3.4 UML DIAGRAM 11
3.6 SYSTEM REQUIREMENTS 19
4 RESULTS AND DISCUSSIONS
4.1 SUMMARY 22
4.2 SCREEN SHOTS 23
5.1 CONCLUSION 36
5.2 FUTURE ENHANCEMENT 37
5.3 REFERENCES 37
6 APPENDIX
vii
LIST OF FIGURES
viii
CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION TO THE PROJECT
Tkinter is a Python Package for creating GUI applications. Python has a lot of GUI
frameworks, but this is the only framework that’s built into the Python standard library. It
has several strengths; it’s cross-platform, so the same code works on Windows, macOS,
and Linux. It is lightweight and relatively painless to use compared to other frameworks.
This makes it a compelling choice for building GUI applications in Python, especially for
applications where a modern shine is unnecessary, and the top priority is to build
something that’s functional and cross-platform quickly.
1.2. AIM AND SCOPE
The main aim of the project is “To Create a Text Editor Using Python”. Text
Editor is the first most and essential need of a software developer those are willing to
write code or simply edit the existing one, working becomes easier due to the
different functionality provided to the user, they are customizable according to the
user needs. As though the ultimate work of a text editor is to edit files then too,
choosing the best editor for programming is a trending topic of all-time in the tech
industry, depending upon you can predict the power and importance of text editor in
developer’s life.
1.3. Feasibility Study
1.3.1. Technical Feasibility
Evaluating the technical feasibility is the trickiest part of a feasibility study. This is
because, .at this point in time, not too many detailed design of the system, making it
difficult to access issues like performance, costs on (on account of the kind of
technology to be deployed) etc. A number of issues have to be considered while doing a
technical analysis.
Proposed project is beneficial only if it can be turned into information systems that
will meet the organizations operating requirements. Simply stated, this test of feasibility
asks if the system will work when it is developed and installed.
Tkinter – This is one of the most Powerful, Widely Used and Platform
Independent library available in Python for creating seamless and nice-looking GUI
applications, it is very easy to use and understand different widgets provided by Tkinter.
MessageBox – This module provides the template classes and a variety of inbuilt
functions for alerting the user, these message boxes can be an info message, an error
message or ask yes/no message.
FileDialog – This module provides the classes and inbuilt functions for creating
file or directory selection windows.
1.3.3.Economic Feasibility
A simple economic analysis which gives the actual comparison of costs and
benefits are much more meaningful in this case. In addition, this proves to be a useful
point of reference to compare actual costs as the project progresses. There could be
various
1.4 SYSTEMS
The existing system consists of entering the details in the Microsoft Excel Sheets
for the storing of the data. When a manager needs information of the employee he
searches for the specified file in the file system. He opens the file and takes the
information. Report Generation done manually by copying the content of the different
files into another file. The Manually generated report was then printed.
ACTIVITY DIAGRAM
Admin
DFD- LEVEL
Unified Modelling language includes a set of graphic notations techniques to create a visual
models of object oriented software intensive systems
.
3.4.1 TYPES OF UML DIAGRAMS
ADMIN
TEAM LEAD
DEVELOPER
TESTER
Processor : Pentium IV
Hard Disk : 40GB
RAM : 256MB
CHAPTER 4
RESULTS AND DISCUSSIONS
4.1 SUMMARY
Tkinter is a GUI library from python from which we can create multiple GUI apps.
Here, using tkinter we will develop a notepad like text editor. This notepad will have the
menu where we can create new file, open existing file, save the file, editing, cut and
paste, all functionality will there python installed. Text Editor GUI using Python Text
editor is an application like notepad to write documents and other files. The text editor is
made using python using Tkinter GUI interface.
It offers various text editor features such as Functions similar to any other plain
text editors, Shows Line Number, Highlights the current line, Shows cursor location at
the bottom, open, close, create and edit files. The application is built using python library
Tkinter. For creating graphic user interface (GUI) on Python we need to use Tkinter
library. We are also having different packages and approaches for creating GUI like QT
for Software Development and Django, Flask for Web app development. Here we
choose Tkinter because it provides a very quick and easy way to create basic GUI
applications.
4.2 SCREEN SHOTS
Tkinter is the standard GUI library for Python. Python when combined with Tkinter
provides a fast and easy way to create GUI applications. Tkinter provides a powerful
object-oriented interface to the Tk GUI toolkit.
Creating a GUI application using Tkinter is an easy task. All you need to do is perform
the following steps −
Import the Tkinter module.
Create the GUI application main window.
Add one or more of the above-mentioned widgets to the GUI application.
Enter the main event loop to take action against each event triggered by the user.
5.3 REFERENCES
2. J. Wolf, “Using GPS data loggers to replace travel diaries in the collection of
travel data,” Georgia Inst. Technol., Citeseer, Tech. Rep., 2000.
import tkinter
import os
from tkinter import *
from tkinter.messagebox import *
from tkinter.filedialog import *
class Notepad:
__root = Tk()
# To add scrollbar
__thisScrollBar = Scrollbar(__thisTextArea)
__file = None
33
def __init__(self,**kwargs):
# Set icon
try:
self.__root.wm_iconbitmap("Notepad.ico")
except:
pass
try:
self.__thisWidth = kwargs['width']
except KeyError:
pass
try:
self.__thisHeight = kwargs['height']
except KeyError:
pass
34
# For left-alling
left = (screenWidth / 2) - (self.__thisWidth / 2)
# For right-allign
top = (screenHeight / 2) - (self.__thisHeight /2)
35
self.__thisFileMenu.add_command(label="Save",
command=self.__saveFile)
self.__thisFileMenu.add_command(label="Exit",
command=self.__quitApplication)
self.__thisMenuBar.add_cascade(label="File",
menu=self.__thisFileMenu)
self.__root.config(menu=self.__thisMenuBar)
self.__thisScrollBar.pack(side=RIGHT,fill=Y)
def __quitApplication(self):
self.__root.destroy()
# exit()
def __showAbout(self):
showinfo("Notepad","Mrinal Verma")
def __openFile(self):
self.__file = askopenfilename(defaultextension=".txt",
37
filetypes=[("All Files","*.*"),
("Text Documents","*.txt")])
if self.__file == "":
# no file to open
self.__file = None
else:
file = open(self.__file,"r")
self.__thisTextArea.insert(1.0,file.read())
file.close()
def __newFile(self):
self.__root.title("Untitled - Notepad")
self.__file = None
self.__thisTextArea.delete(1.0,END)
def __saveFile(self):
38
if self.__file == None:
# Save as new file
self.__file = asksaveasfilename(initialfile='Untitled.txt',
defaultextension=".txt",
filetypes=[("All Files","*.*"),
("Text
Documents","*.txt")])
if self.__file == "":
self.__file = None
else:
else:
file = open(self.__file,"w")
file.write(self.__thisTextArea.get(1.0,END))
file.close()
def __cut(self):
39
self.__thisTextArea.event_generate("<<Cut>>")
def __copy(self):
self.__thisTextArea.event_generate("<<Copy>>")
def __paste(self):
self.__thisTextArea.event_generate("<<Paste>>")
def run(self):
40
41