Simple Music Player advance project Using Python 2024

 Simple Music Player Using Python

Hello friends, do you know that there are many ways to make music players from simple to advanced levels?

Here, we are presenting you with two very very basic music player in python.

One of them is a simple program and the other one is a GUI program.

For the simple program, we have used pygame which is a famous gaming module in python and its use is very simple.

So, you need to install pygame inside your system if you don’t have it.

To install pygame type "pip install pygame" inside cmd.

For the GUI one, you should have tkinter and pygame both.

There are so many small tkinter projects which you can see if you have any problem with tkinter.

So, now let’s see the codes for both programs.

Code for the GUI program

from pygame import mixer

from tkinter import *

root = Tk()



def pause():

def play():

def resume():

Label(root, text="Welcome to music player", font="lucidia 30 bold").pack()

Button(text="Play", command=play).place(x=200, y=100)

Button(text="Pause", command=pause).place(x=250, y=100)

Button(text="Resume", command=resume).place(x=310, y=100)

Button(text="Quit", command=quit).place(x=380, y=100)


Code for simple program

import pygame

from pygame import mixer




screen = pygame.display.set_mode((600, 400))"filename.mp3")


print("Press 'p' to pause 'r' to resume")

print("Press 'q' to quit")

running = True

while running:

    for event in pygame.event.get():

        if event.type == pygame.QUIT:

            running = False

        if event.type == pygame.KEYDOWN:

            if event.key == pygame.K_p:


            if event.key == pygame.K_r:


            if event.key == pygame.K_q:

                running = False


Post a Comment