Hello i just created a mp3 player for a school project with python and right now , i finished it , so i need to present it to the jury.
NB : For those how red my 1st post i solved the problem with re-installing python choosing 3.4 version instead of 3.5
So i need to make an executable from this python script . I made some research and found about cx_freeze and creating a setup.py. So that's what i made :
First that is what my code needs as an import :
import pygame
import ctypes
from tkinter import *
import webbrowser
from pygame import mixer
import random
import os
import sys
And here is my setup.py :
from cx_Freeze import setup, Executable
setup(
name = "Penguin Player",
version = "1.0",
author = "Penguin Team",
author_email = "Omitted",
options = {"build_exe": {"packages":["pygame","ctypes","tkinter","webbrowser","random"],
"include_files": ["wpp.gif", "remerciements.txt",
"Instructions.txt", "ico.ico",
"Bouton play.gif", "Bouton Next.gif",
"Bouton Like.gif", "Bouton pause.gif",
"Bouton end.gif","musiques/house/Galantis - Runaway.gif","musiques/house/Galantis - Runaway.mp3",
"musiques/house/Gazzo -What You Waiting For.gif","musiques/house/Gazzo -What You Waiting For.mp3",
"musiques/house/Kygo & Labrinth - Fragile.gif","musiques/house/Kygo & Labrinth - Fragile.mp3",
"musiques/pop/Charlie Winston -Truth.gif","musiques/pop/Charlie Winston -Truth.mp3"
"musiques/pop/Lukas Graham -7 Years.gif","musiques/pop/Lukas Graham -7 Years.mp3",
"musiques/pop/Milky Chance - Stolen Dance.gif","musiques/pop/Milky Chance - Stolen Dance.mp3"]}},
executables = [Executable("Mp3 player.py")],
)
It seems to work , i have any error showing when "freezing". After freezing i went to th exe folder and ran it : not error the Interface showed up... But , like we know IT and programming ...
I had an error when starting the program by reading the first music...
pygame.error: Couldn't open 'musiques/pop/Charlie Winston -Truth.mp3'
(Same for all the mp3 files )
So in my setup.py i think i neeed to add something about reading mp3 files i think ... But what ? That's the question ..
Don't forget that before freezing my program is runnning mp3 files without any problem !
Best wishes !
Regards