Professional Documents
Culture Documents
I would like to express my special thanks of gratitude to my teacher Mr. Rahul Bhat who gave
me the golden opportunity to do this wonderful project on the topic
Which also help me in doing a lot of researches and I come to know about so many things
I am really thankful to do this project work. Secondly I would also like to thanks my
parents and my friends who helped me a lot in finishing this project. I’m making this project
not only for marks but also to increase my knowledge.
Contents
CERTIFICATE……..
ACKNOLEDGEMENT……
OVERVIEW OF PYTHON……………
SOFTWARE USED……………
HARDWARE REQUIREMENT………
WORKING DESCRIPTION……....
CODING……………………………
OUTPUT SCREENS……………….
APPLICATIONS………………………
FUTURE SCOPE……………………
OVERVIEW OF PYTHON
What is Python?
Python is a popular programming language. It was created by Guido van Rossum, and released
in 1991.It is used for:
Why Python?
Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
Python has a simple syntax similar to the English language.
Python has syntax that allows developers to write programs with fewer lines than
some other programming languages.
Python runs on an interpreter system, meaning that code can be executed as soon as it is
written. This means that prototyping can be very quick.
Python can be treated in a procedural way, an object-orientated way or a functional
way.
Good to know
The most recent major version of Python is Python 3, which we shall be using in this
tutorial. However, Python 2, although not being updated with anything other than
security updates, is still quite popular.
It is possible to write Python in an Integrated Development Environment, such as
Thonny, Pycharm, Netbeans or Eclipse which are particularly useful when managing
larger collections of Python files.
Python was designed for readability, and has some similarities to the English
language with influence from mathematics.
Python uses new lines to complete a command, as opposed to other programming
languages which often use semicolons or parentheses.
Python Syntax
Or by creating a python file on the server, using the .py file extension, and running it in the
Command Line:
Python Indentations
Where in other programming languages the indentation in code is for readability only, in
Python the indentation is very important.
Example:
if 5 > 2:
print("Five is greater than two!")
Example:
if 5 > 2:
print("Five is greater than two!")
Python Variables
In Python variables are created the moment you assign a value to it:
Example
Variables in Python:
x=5
y = "Hello, World!"
Comments start with a #, and Python will render the rest of the line as a
comment:
Example
Comments in Python:
#This is a comment.
print("Hello, World!")
SPYDER
IDLE
Sublime Text 3
Atom
Thonny
PyCharm
Visual Studio Code
Vim
repl.it
HARDWARE REQUIREMENT:
CODING
#project.py
def about():
call(["python","about.py
"])
def display_student():
call(["python","display.py
"])
def forgot():
messagebox.showinfo('Forgot Password',"CONTACT
ADMINISTRATOR") def set_result():
if num.get() == 63:
webbrowser.open("file:///F:/HTML/DMC.ht
ml")
elif num.get() == 55:
webbrowser.open("file:///F:/HTML/DMC_Nikhil.h
tml")
else:
messagebox.showerror("Error","Roll No.
Incorrect") def registration():
call(["python","login.py
"]) def allclear():
enter2.delete(0,
END) root = Tk()
root.title("Student Management")
txt = StringVar(value="Welcome To Student Management System")
Display = Label(root,font=('times new
roman',30,'bold'),fg='white',width=100,bd=10,bg='green',justify='center',textva
riable= txt)
Display.pack()
#****************menubar
menubar=Menu(root)
#*************File
filemenu=Menu(menubar,tearoff
=0)
filemenu.add_command(label="New",command=registration)
filemenu.add_command(label="Display
Students",command=display_student) filemenu.add_separator()
filemenu.add_command(label="Exit",
command=root.destroy)
menubar.add_cascade(label="File",menu=filemenu)
#************Edit
#*************Help
helpmenu=Menu(menubar,tearoff=0)
helpmenu.add_command(label="About",command=a
bout)
helpmenu.add_command(label="Forgot
Password",command=forgot)
menubar.add_cascade(label="Help",menu=helpmenu)
#********************
txt1 = StringVar(value="UIET")
Display = Label(root,font=('times new
roman',30,'bold'),fg='black',width=100,bd=10,bg='red',justify='center',textvari
able=tx t1)
Display.pack()
txt2 = StringVar(value="KURUKSHETRA UNIVERSITY")
Display = Label(root,font=('times new
roman',30,'bold'),fg='black',width=100,bd=10,bg='red',justify='center',textvari
able=tx t2)
Display.pack()
txt3 = StringVar(value="KURUKSHETRA")
Display = Label(root,font=('times new
roman',30,'bold'),fg='black',width=100,bd=10,bg='red',justify='center',textvari
able=tx t3)
Display.pack()
txt4 = StringVar(value="Pehowa Road")
Display = Label(root,font=('times new
roman',30,'bold'),fg='black',width=100,bd=10,bg='red',justify='center',textvari
able=tx t4)
Display.pack()
label=Label(root,font=('times new roman',20,'bold'),text='BATCH')
label.pack(pady=15)
label=Label(root,font=('times new roman',20,'bold'),text='CSE',bg='grey')
label.pack(pady=15)
label=Label(root,font=('times new roman',20,'bold'),text='ENTER
ROLL NO.') label.pack(pady=15)
num = IntVar()
enter2=Entry(root,bd=5,width=15, textvariable =
num) enter2.pack(pady=15)
enter2.focus()
btn1=Button(root,font=('times
new
roman',20,'bold'),fg='green',width=20,bd=5,bg='grey',justify='center',text='C
HECK RESULT',command=set_result)
btn1.pack()
btn2=Button(root,font=('times
new
roman',20,'bold'),fg='green',width=20,bd=5,bg='grey',justify='center',text='CLE
AR',c ommand=allclear)
btn2.pack()
label=Label(root,font=('times new roman',20,'bold'),bg='white',text='Roll
No. Must Be 63 or 55')
label.pack(pady=15)
root.config(menu=menub
ar)
root.configure(width=10,height=600,bg='GR
EY')
root.mainloop()
#login.py
def submit():
if login_request.get()!="DANISH" or
password_request.get()!="correction":
messagebox.showerror("Access Denied","Wrong USERNAME Or
PASSWORD")
else:
call(["python","new form.py"])
root = Tk()
root.title("LOG
IN...")
def update():
conn=
sqlite3.connect("mydata.db")
mycursor= conn.cursor()
record_id = record_delete.get()
mycursor.execute("""UPDATE Students
SET First_name = :first,
Last_Name = :last,
Email_Id = :email,
Contact_Number =
:phone, Course = :course
'oid': record_id
})
conn.commit(
) conn.close()
editor.destroy
()
def edit():
global
editor
if record_delete.get() == "":
messagebox.showerror("NO Input","Enter any
number") else:
editor = Tk()
editor.title("UPDATE A RECORD")
editor.geometry("400x400")
conn =
sqlite3.connect("mydata.db")
mycursor = conn.cursor()
record_id = record_delete.get()
mycursor.execute("SELECT * FROM Students WHERE oid =" +
record_id) records = mycursor.fetchall()
global
firstname_editor
global
lastname_editor
global email_editor
global phone_editor
global course_editor
#print(records)
for record in records:
firstname_editor.insert(0,
record[0])
lastname_editor.insert(0,
record[1]) email_editor.insert(0,
record[2]) phone_editor.insert(0,
record[3]) course_editor.insert(0,
record[4])
def delete():
conn=
sqlite3.connect("mydata.db")
mycursor= conn.cursor()
conn.commit
()
conn.close()
def submit():
if firstname.get() == "" or lastname.get() =="" or email.get()
== 0 or phone.get()=="" or course.get() == "":
messagebox.showerror("error","no
entry") else:
conn=
sqlite3.connect("mydata.db")
mycursor= conn.cursor()
mycursor.execute('CREATE TABLE IF NOT EXISTS Students
(First_Name text, Last_Name text, Email_Id text, Contact_Number integer,
Course Text)')
mycursor.execute("INSERT INTO Students
VALUES
(:firstname,:lastname,:email,:phone,:course)",
{
'firstname' :
firstname.get(),
'lastname' :
lastname.get(), 'email' :
email.get(),
'phone' :
phone.get(),
'course' :
course.get()
})
conn.commit
()
conn.close()
firstname.delete(0,
END)
lastname.delete(0,
END) email.delete(0,
END) phone.delete(0,
END) course.delete(0,
END)
def query():
conn=
sqlite3.connect("mydata.db")
mycursor= conn.cursor()
print_records = ''
for record in records:
print_records += str(record[5]) + "\t" + str(record[0]) +" " + str(record[1])
+
"\n"
query_label = Label(root, text =
print_records)
query_label.grid(row=7,column=0,columnspa
n=2)
conn.commit
()
conn.close()
#about.py
Python has simple syntax, modular architecture, rich text processing tools and the ability to
work on multiple operating systems which make it a desirable choice for developing desktop-
based applications. There are various GUI toolkits like wxPython, PyQt or PyGtk available
which help developers create highly functional Graphical User Interface (GUI). The various
applications developed using Python includes:
Python has been used to make 2D imaging software such as Inkscape, GIMP, Paint
Shop Pro and Scribus. Further, 3D animation packages, like Blender, 3ds Max,
Cinema 4D, Houdini, Lightwave and Maya, also use Python in variable
proportions.
The higher speeds, productivity and availability of tools, such as Scientific Python
and Numeric Python, have resulted in Python becoming an integral part of
applications involved in computation and processing of scientific data. 3D
modeling software, such as FreeCAD, and finite element method software, such as
Abaqus, are coded in Python.
Games:
Python has various modules, libraries and platforms that support development of
games. For example, PySoy is a 3D game engine supporting Python 3, and
PyGame provides functionality and a library for game development. There have
been numerous games built using Python including Civilization-IV, Disney’s
Toontown Online, Vega Strike etc.
Python has been used to create a variety of web-frameworks including CherryPy, Django,
TurboGears, Bottle, Flask etc. These frameworks provide standard libraries and modules which
simplify tasks related to content management, interaction with database and interfacing with
different internet protocols such as HTTP, SMTP, XML-RPC, FTP and POP. Plone, a
content management system; ERP5, an open
source ERP which is used in aerospace, apparel and banking; Odoo – a consolidated suite of
business applications; and Google App engine are a few of the popular web applications
based on Python.
With features that include special libraries, extensibility, scalability and easily readable
syntax, Python is a suitable coding language for customizing larger applications. Reddit,
which was originally written in Common Lips, was rewritten in Python in 2005. Python also
contributed in a large part to functionality in YouTube.
4. Operating Systems:
Python is often an integral part of Linux distributions. For instance, Ubuntu’s Ubiquity
Installer, and Fedora’s and Red Hat Enterprise Linux’s Anaconda Installer are written in
Python. Gentoo Linux makes use of Python for Portage, its package management system.
5. Language Development:
Python’s design and module architecture has influenced development of numerous languages.
Boo language uses an object model, syntax and indentation, similar to Python. Further,
syntax of languages like Apple’s Swift, CoffeeScript, Cobra, and OCaml all share similarity
with Python.
6. Prototyping:
Besides being quick and easy to learn, Python also has the open source advantage of being free
with the support of a large community. This makes it the preferred choice for prototype
development. Further, the agility, extensibility and scalability and ease of refactoring code
associated with Python allow faster development from initial prototype.
Since its origin in 1989, Python has grown to become part of a plethora of web-based,
desktop-based, graphic design, scientific, and computational applications. With Python
available for Windows, Mac OS X and Linux / UNIX, it offers ease of development for
enterprises. Additionally, the latest release Python 3.4.3 builds on the existing strengths of the
language, with drastic improvement in Unicode support, among other new features.
FUTURE SCOPE OF PYTHON
(WHAT ABOUT PYTHON IN
FUTURE!)
END