Member-only story
Make Your Own Music Player with Python

So here we are going to create our own music player with the help of Python. For this we will use three packages:
1. Tkinter → for UI
2. Pygame → for playing the music
3. os → for accessing your system’s files
So here we will see the each step for creating music player, we have divided our code into four parts.
In the first part we will import all the packages. Second we will create the UI. Third, we import all the music from the system and represent in application. Fourth, we define a function which will help in playing the particular music.
Before importing all these three packages we have to install these packages in our system.
pip install pygame
pip install tkinter
Os is already installed so we just need to import it:
from tkinter import *
from pygame import mixer
import os
So now we will see the next step.
So in this we are going to create UI for the application.
root = Tk()root.title(“music player”)Button(root,text= “play”, command = playsong).grid(row =1 , column =…