You are on page 1of 29

A Major Project Report

On
MUSIC PLAYER USING PYTHON TKINTER

THIS PROJECT REPORT IS SUBMITTED TO


STATE BOARD OF TECHNICAL EDUCATION AND TRAINING
IN PARTIAL FULLFILMENT OF THE REQUIREMENT
FOR THE AWARD OF
DIPLOMA
In
ELECTRONICS &COMMUNICATION ENGINEERING
BY
 T.SUNIL KUMAR (21486-EC-030)
 K.SHIVA PRASAD (21486-EC-036)
 Y.GAUTHAM (21486-EC-039)
 J.KARTHIK (21486-EC-031)
 R.VIKRAM TEJA (21486-EC-023)

Under the Esteemed Guidance of


SRI RAM
Assistant professor

DEPARTMENT OF ELECTRONICS &COMMUNICATION ENGINEERING

CHRISTU JYOTHI INSTITUTE OF TECHNOLOGY AND SCIENCE

NBA & NAAC Accredited, Permanently Affiliated to JNTUH


Colombonagar, Yeshwanthapur, Jangaon, 506167

2023-2024
CHRISTU JYOTHI INSTITUTE OF TECHNOLOGY AND SCIENCE
NBA & NAAC Accredited, Permanently Affiliated to JNTUH

Colombonagar, Yeshwanthapur, Jangaon, Warangal, 506167

DIPLOMA IN ELECTRONICS &COMMUNICATION ENGINEERING

CERTIFICATE
This is to certify that the report entitled ON “ MUSIC PLAYER USING PYTHON
TKINTER” is submitted to State Board Of Technical Education and Training,
Hyderabad by T.SUNILKUMAR(21486-EC-030) , K.SHIVA PRASAD(21486-EC-
036), Y.GAUTHAM(21486-EC-O39), J.KARTHIK(21486-EC-031), R.VIKRAM
TEJA(21486-EC-023). of final year Diploma in ELECTRONICS
&COMMUNICATION ENGINEERING (2023-2024) in partial fulfillment for the
requirements of the degree of Diploma in ELECTRONICS &COMMUNICATION
ENGINEERING is a Bonafied record of work done by them under my Supervision
and Guidance

INTERNAL GUIDE H.O.D 486 EXTERNAL EXAMINER


ACKNOWLEDGEMEN
We would take immense pleasure to acknowledge with gratitude, the help and support
extended during the course of our project entitled “MUSIC PLAYER USING PYTHON
TKINTER” from people who have helped in the successful completion of this project all.

We are heartily thankful to the Director Rev. Fr.D.VIJAYA PAUL REDDY, for giving this
opportunity.

We express thanks to our Principal Dr.S.CHANDRASHEKAR REDDY, for giving this


opportunity.

We express thanks to our Vice-Principal , Mr.P.THIRUPATHI, for giving this opportunity

We express thanks and gratitude to Mr.P.THIRUPATHI, VICE-PRINCIPAL,


DEPARTMENT OF ELECTRONICS &COMMUNICATION ENGINEERING for his
encouraging support and guidance throughout the project.

We wish to express our deep sense of gratitude to our coordinator, Mr.P.THIRUPATHI,


VICE-PRINCIPAL for his valuable guidance and useful suggestions.

We take this opportunity to express our sincere thanks to our project guide, Vice-Principal ,
Mr.P.THIRUPATHI for his exemplary guidance and monitoring throughout the course of
this project. Without the help and guidance given by him time to time, we couldn’t have
completed the project.

We would like to express our special gratitude and thanks to all who extended their
helping hand in accomplishment of the project.

Thanking you,

 T.SUNIL KUMAR (21486-EC-030)


 K.SHIVA PRASAD (21486-EC-036)
 Y.GAUTHAM (21486-EC-039)
 J.KARTHIK (21486-EC-031)
 R.VIKRAM TEJA (21486-EC-023)
INTRODUCTION

Python is a high-level, multi-paradigm programming language. As Python is an


interpreter-based language, it is easier to learn compared to some of the other
mainstream languages. Python is a dynamically typed language with very intuitive data
types. Python is an open-source and cross-platform programming language. It is
available for use under Python Software Foundation License (compatible to GNU
General Public License) on all the major operating system platforms Linux, Windows
and Mac OS. The design philosophy of Python emphasizes on simplicity, readability
and unambiguity. Python is known for its batteries included approach as Python
software is distributed with a comprehensive standard library of functions and
modules.

Python – History:

Guido Van Rossum, a Dutch programmer, created Python programming language. In


the late 80's, he had been working on the development of ABC language in a computer
science research institute named Centrum Wiskunde & Informatica (CWI) in the
Netherlands. In 1991, Van Rossum conceived and published Python as a successor of
ABC language.

Python 1.0

In January 1994, version 1.0 was released, armed with functional programming tools,
features like support for complex numbers etc.

Python 2.0

Next major version − Python 2.0 was launched in October 2000. Many new features
such as list comprehension, garbage collection and Unicode support were included with
it.

Python 3.0
Python 3.0, a completely revamped version of Python was released in December 2008.
The primary objective of this revamp was to remove a lot of discrepancies that had
crept in Python 2.x versions. Python 3 was backported to Python 2.6. It also included a
utility named as python2to3 to facilitate automatic translation of Python 2 code to
Python 3.

Current Version

Meanwhile, more and more features have been incorporated into Python's 3.x branch.
As of date, Python 3.11.2 is the current stable version, released in February 2023.

HOW TO INSTALL PYTHON:

STEP 1: Go to python.org/downloads.
STEP 2: Choose the version suitable for your operating system (windows,macOS,or
Linux) and download the installer.

STEP 3: Double-click the downloaded file and follow the installation instructions.

STEP 4: During the installation process, you can customize the installation location
and add python to your system’s PATH.
STEP 5: Open a command prompt(on windows) or a terminal(on macOS or Linux).
You should see the version number displayed.

HOW TO INSTALL PYCHARM:

STEP 1: Go to the official PyCharm


STEP 2: CLICK on the "Download" button.
STEP 3: Choose the edition you want to download (PyCharm Community or
PyCharm Professional).

STEP 4: Select your operating system (Windows, macOS, or Linux).Download the


installer and run it.
STEP 5: Follow the installation wizard, selecting any additional settings or options as
needed.

STEP 6 : Once the installation is complete, you can launch PyCharm from the Start
menu (Windows) or the Applications folder (macOS/Linux).
PYTHON-FEATURES:

1.Python is Easy to Learn


This is one of the most important reasons for the popularity of Python. Python has a
limited set of keywords. Its features such as simple syntax, usage of indentation to avoid
clutter of curly brackets and dynamic typing that doesn't necessitate prior declaration
of variable help a beginner to learn Python quickly and easily.

2.Python's Standard Library


Even though it has a very few keywords (only Thirty Five), Python software is
distributed with a standard library made of large number of modules and packages.
Thus Python has out of box support for programming needs such as serialization, data
compression, internet data handling, and many more. Python is known for its batteries
included approach.

3.Easy to Learn
Compared to C++, Python has a simpler syntax. Its code is more readable. Writing C++
code seems daunting in the beginning because of complicated syntax rule such as use of
curly braces and semicolon for sentence termination.
4.Python is Interactive
Standard Python distribution comes with an interactive shell that works on the
principle of REPL (Read − Evaluate − Print − Loop). The shell presents a Python
prompt >>>. You can type any valid Python expression and press Enter. Python
interpreter immediately returns the response and the prompt comes back to read the
next expression.

5.Portability
Python code is easily portable from one OS to other. C++ code is not portable as it must be
recompiled if the OS changes.

6.Python is Extensible
The term extensibility implies the ability to add new features or modify existing features. As
stated earlier, CPython (which is Python's reference implementation) is written in C. Hence
one can easily write modules/libraries in C and incorporate them in the standard library.
There are other implementations of Python such as Jython (written in Java) and IPython
(written in C#). Hence, it is possible to write and merge new functionality in these
implementations with Java and C# respectively.

PYTHON-APPLICATIONS:

1.Web Development:
Frameworks like Django and Flask are popular for building web applications.

Python is used for both server-side logic and scripting in web development.

2.Data Science and Machine Learning:


Python, along with libraries like NumPy, Pandas, and scikit-learn, is widely used for
data analysis and machine learning applications.

3.Artificial Intelligence and Natural Language Processing:


Python is commonly used for AI and NLP tasks with libraries like TensorFlow,
PyTorch, and NLTK.
4.Scientific Computing:
Python is widely used in scientific research and simulations due to its simplicity and
extensive libraries (e.g., SciPy, Matplotlib).

5.Automation and Scripting:


Python's readability and ease of use make it a preferred choice for automating
repetitive tasks and writing scripts.

6.Game Development:
Pygame is a popular library for developing simple games using Python.

7.Desktop GUI Applications:


Libraries like Tkinter and PyQt enable the creation of desktop graphical user interface
(GUI) applications.

8.Network Servers and Protocols:


Python is used for building network servers, and it supports various internet protocols.

9.Cybersecurity:
Python is used in cybersecurity for tasks like penetration testing, scripting, and building
security tools.

10.Internet of Things (IoT):


Python is used in IoT projects for data processing, device communication, and
automation.
ADVANTAGE OF PYTHON:

1.Readability and Simplicity:


Python's syntax is clear and readable, making it easy for beginners to learn
and write code.

2.Versatility:
Python is a versatile language suitable for a wide range of applications,
from web development to scientific computing.

3.Extensive Libraries and Frameworks:


Python has a rich ecosystem of libraries and frameworks that facilitate
development in various domains, such as Django for web development and
TensorFlow for machine learning.

4.Community and Support:


Python has a large and active community, providing ample resources,
documentation, and support for developers.

5.Cross-Platform Compatibility:
Python is compatible with major operating systems, allowing developers to
write code that runs seamlessly on different platforms.

6.Integration Capabilities:
Python can easily integrate with other languages like C and C++, enabling
developers to use existing code and libraries.

DISADVANTAGES OF PYHTON:
1.Performance:
Python can be slower compared to languages like C or C++ due to its interpreted
nature. However, for many applications, the performance difference is negligible.

2.Global Interpreter Lock (GIL):


The Global Interpreter Lock can limit the execution of multiple threads simultaneously
in a multi-core system, affecting performance in multi-threaded applications.

3.Mobile Development:
While Python is used in mobile development (e.g., with frameworks like Kivy or
BeeWare), it may not be as dominant as languages like Swift for iOS or Kotlin for
Android.

4.Not Ideal for Memory-Intensive Tasks:


Python may not be the best choice for memory-intensive tasks, as it might not handle
large-scale data as efficiently as languages like C or Java.

5.Design Restrictions:
The enforced indentation and whitespace requirements can be a point of contention for
developers who prefer more flexible formatting.

6.Less Native Mobile Support:


Python is not as commonly used for developing native mobile applications as languages
like Swift or Kotlin.

PURPOSED METHOD
1. Tkinter :-
Tkinter is a Python library for creating graphical user interfaces (GUIs). It comes
bundled with most Python installations and provides tools for creating windows,
buttons, labels, and other GUI elements.

2. fnmatch :-
fnmatch is a Python module used for Unix-style filename pattern matching. It provides
a function, also called fnmatch, that checks whether a given filename matches a
specified pattern containing wildcards like '*' and '?'. It's often used for tasks such as
filtering files based on patterns.

3. OS :-
The os module in Python provides a way of interacting with the operating system. It
includes functions for tasks such as file and directory manipulation, environment
variable access, and process management.
various operating systems (os) such as Windows, macOS, and Linux etc.

4. Pygame :-
Pygame is a set of Python modules designed for writing video games. It builds on top of
the Simple DirectMedia Layer (SDL) library and provides functionalities for handling
graphics, sound, input devices, and more.

Some key features of Pygame include:


 Graphics: Pygame allows you to create 2D games and graphics easily.

 Sound: It supports playing and mixing sounds in various formats.

 Input Handling: You can capture user input, such as keyboard and mouse
events.

 Event Handling: Pygame provides a way to handle events like mouse clicks and
keypresses.
 Sprites: Sprite handling simplifies working with game entities.
5. Mixer :-
A "mixer" could refer to a module or library used for audio processing or mixing
sounds. One commonly used library for this purpose is pygame.mixer. It allows you to
work with sound effects and music in your Python programs.

This module is part of the Pygame library, which is used for game development in
Python. The pygame.mixer module specifically deals with mixing and playing sounds in
games.

6. Canvas :-
A "canvas" typically refers to a graphical drawing area or surface provided by a
graphical user interface (GUI) library. One commonly used GUI library is tkinter, and
it includes a Canvas widget.
The Canvas widget in tkinter allows you to draw various shapes, text, and images on a
designated area within a GUI. It provides a versatile space for creating graphical
elements and interactive visuals in your Python programs.

7. rootpath :- A common approach is to use the os module to navigate the file system
and determine the current working directory or the directory of the script being
executed.

8. init( ) :-
The initialization method in a class. It is a special method that gets called when an
object of the class is instantiated. This method is commonly used to initialize the
attributes of the object.

9. Label:
Tkinter Label is a widget that is used to implement display boxes where you can place
text or images. The text displayed by this widget can be changed by the developer at any
time you want. It is also used to perform tasks such as to underline the part of the text
and span the text across multiple lines. It is important to note that a label can use only
one font at a time to display text. To use a label, you just have to specify what to display
in it (this can be text, a bitmap, or an image).

Syntax:
w = Label ( master, option, … )

10. def :-

Python def keyword is used to define a function, it is placed before a function name that
is provided by the user to create a user-defined function. In Python, a function is a
logical unit of code containing a sequence of statements indented under a name given
using the “def” keyword. In Python def keyword is the most used keyword.

Use of def keyword:-

• In the case of classes, the def keyword is used for defining the methods of a class.
• def keyword is also required to define the special member function of a class like
_init_().
The possible practical application is that it provides the feature of code reusability
rather than writing the piece of code again and again we can define a function and write
the code inside the function with the help of the def keyword. It will be more clear in the
illustrated example given below. There can possibly be many applications of def
depending upon the use cases.

We can use def in Python:


• Create a def function with No Arguments.
• Create def function to find the subtraction of two Numbers.
• Create def function with the first 10 prime numbers.
• Create a function to find the factorial of a Number.
• Python def keyword example with *args.
• Python def keyword example with **kwargs.
• Passing Function as an Argument.
• Python def keyword example with the class.

11. Listbox :-
A Listbox is a widget commonly used in graphical user interface (GUI) libraries to
display a list of items. One popular GUI library is tkinter, and it includes a Listbox
widget.

12. Anchor :-
Anchors are used to define where text is positioned relative to a reference point.

Here is list of possible constants, which can be used for Anchor attribute.

 NW
 N
 NE
 W
 CENTER
 E
 SW
 S
 SE
13. TEXT :-
The Text widget is used to display text in multiple lines.

14. If Else :-
you can use the if, elif (optional), and else statements to implement conditional logic.
The if statement alone tells us that if a condition is true it will execute a block of
statements and if the condition is false it won’t. But if we want to do something else if
the condition is false, we can use the else statement with the if statement to execute a
block of code when the if condition is false.
15. pack( ) :-
In Tkinter, pack() is a geometry manager method used to organize widgets in blocks
before placing them in the parent widget. It is commonly used to control how widgets
are displayed within a container.
Compared to the grid manager, the pack manager is somewhat limited, but it’s much
easier to use in a few, but quite common situations:
 Put a widget inside a frame (or any other container widget), and have it fill the
entire frame
 Place a number of widgets on top of each other
 Place a number of widgets side by side

16. padx :-
The padx is nothing but padding inside the layout, X indicates the x axis. The elements
inside the layout tells that it needs more space inside the layout than what is allocated.

17. pady :-
The pady is nothing but padding inside the layout, Y indicates the y axis.Add external
padding to the left and right of the widget.
18. Grid( ) :-

The Grid geometry manager puts the widgets in a 2-dimensional table. The master
widget is split into a number of rows and columns, and each “cell” in the resulting
table can hold a widget. The grid manager is the most flexible of the geometry
managers in Tkinter.
Using the grid manager is easy. Just create the widgets, and use the grid method to tell
the manager in which row and column to place them.
19. List insert() :-
List insert() method in Python is very useful to insert an element in a list. It is used in
editing lists with huge amount of data, as inserting any missed value in that list is made
very easy with this Python function.

20. Frame :-

A frame is a rectangular region on the screen. A frame can also be used as a


foundation class to implement complex widgets. It is used to organize a group of
widgets.

21. Buttons :-

The Button widget is used to add buttons in a Python application. These buttons can
display text or images that convey the purpose of the buttons. You can attach a function
or a method to a button which is called automatically when you click the button.
22. Scale :-
It is used to provide a graphical slider that allows to select any value from that scale.
The general syntax is:-
w = Scale(master, option=value)
master is the parameter used to represent the parent window.

There are number of options which are used to change the format of the widget.
Number of options can be passed as parameters separated by commas. Some of them
are listed below.

 cursor: To change the cursor pattern when the mouse is over the widget.

 Activebackground: To set the background of the widget when mouse is over the
 widget.

 bg: to set the normal background color.

 orient: Set it to HORIZONTAL or VERTICAL according to the requirement.

 from_: To set the value of one end of the scale range.


 to: To set the value of the other end of the scale range.

23. Command :-

The command parameter is used to associate a function or method with a widget,


typically a button. This function is executed when the widget is interacted with,
such as when a button is clicked.
when the button is clicked, the button_click() function is called, and it updates the
text of the label. You can customize the command parameter to execute different
functions or methods based on your requirements.

You might also like