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. 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
0 Comments
Leave a Reply. |