


insert(pos, item) pos += 1įor what concerns loading and playing sounds, we use pygame as below. SINGLE) for item in song_list: pos = 0 play_list. Listbox(music_player, font=”Helvetica 12 bold”, bg=”yellow”, selectmode=tkr. In addition, we create a for loop in order to push the program to select each item from the song_list and insert them into the Listbox.
Audify music player stops working code#
Instead, the following code presents a variable called play_list which brings the interface to display the items to the user. listdir() #it returns the list of files song chdir(directory) #it permits to chenge the current dir song_list = os. To do that the OS module will help us to create interaction between the interface and our operating system. Now, it is time to create a directory that prompts the user to choose the folder where the music files are listed. So to create the interface, we will write the following code that permits to create the interface, add the title of the interface and set the dimension of the interface. Part II: Create the window of your music player and write the prompt command for music selectionĪfter we have imported the modules, we need to create the interface and establish the interaction with our operating system. import pygame #used to create video games import tkinter as tkr #used to develop GUI from tkinter.filedialog import askdirectory #it permit to select dir import os #it permits to interact with the operating system In this second phase, I will use Atom as python editor. For creating our MP3 Music Player we will use the sound component. Pygame is a module that is used for creating videogames. Out: (myenv) C:\Users\moryb\Environments> We can activate the environment with the following command: myenv\Scripts\activate.bat Inside the directory myenv there is a copy of Python interpreter, the standard library and the various supporting files. If you have installed python 3 you can easily digit: virtualenv myenv Now, we can create a virtual environment named myenv. The second step is to use a module virtualenv to create isolated virtual environments.

mkdir EnvironmentsĪnd be sure to be into the directory ‘Environments’. So, open your terminal and create a directory as below. In this way the program is available only within the set environment and not throughout my computer.
Audify music player stops working install#
The first step is to create a directory called environments where to store all your virtual Environments and install the python modules. Part I: Set the environment and import modules
