Ide Lab Assignment Week-6

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

IDE LAB ASSIGNMENT WEEK-6

Name:D.Venkata Sai Bhargav


Roll no:121810316038
Sec:-4B16

""" 5G Music Player """


from tkinter import filedialog
from tkinter import ttk
import tkinter.messagebox
from tkinter import
import os
import threading
from ttkthemes import themed_tk as tk
from mutagen.mp3 import MP3
import time
from pygame import mixer

root = tk.ThemedTk()
#root.geometry("555x290")
root["bg"]="#195FBA"
#setting theme for player
root.set_theme("elegance")
statusbar = ttk.Label(root, text="5G Music Player", anchor=W, font='Arial 8
italic')
statusbar.pack(side=BOTTOM, fill=X)
statusbar1 = ttk.Label(root, text="5G Music Player", anchor=W, font='Arial 8
italic')
statusbar1.pack(side=TOP, fill=X)
#Create the menubar
menubar = Menu(root)
root.config(menu=menubar)
#Create the submenu
subMenu = Menu(menubar, tearoff=0)
#list for storing play
def browse_file():

global filename_path

filename_path = filedialog.askopenfilename()

add_to_songplaylist(filename_path)

mixer.music.queue(filename_path)

def add_to_songplaylist(filename):

filename = os.path.basename(filename)

index = 0

songplaylistcontainer.insert(index, filename)

songplaylist.insert(index, filename_path)

index += 1

menubar.add_cascade(label="File", menu=subMenu)

subMenu.add_command(label="Open", command=browse_file)

subMenu.add_command(label="Exit", command=root.destroy)

mixer.init()
#initializing the mixer

First we need to install libraries like pygame, ttkthemes, mutagen, time


How to install means at the bottom of the pycharm we can see a name terminal
click on that we can see name like local click on that and you need enter the
libraries names at the final you can see successfully installed.After that you
need import the things that we want from the libraries.Then we need to take the
them for the music player and we need to name the music player, i took as “5G
Music player” and next we need to select the font and styles for the music
player,At final we need set the buttons for the player.

You might also like