1

Every time I open it, I see a cmd window for a second and then it closes. I also have a rick roll audio file called sound.mp3.

Setup.py code:

import sys
from cx_Freeze import setup, Executable

packages  = ["playsound", "os", "time", "multiprocessing"]    
Sound = Executable(
    script = "sound.py",
    targetName = "sound.py",
    )    
setup(name = "sound" ,
      version = "0.1" ,
      options = {"build_exe": {"packages": packages}},
      description = "" ,
      executables = [Sound]
      )

Sound.py code:

import multiprocessing
from playsound import playsound
import os

file_location = os.path.dirname(__file__) + '\sound.mp3.mp3'
playsound(file_location)

Edit: I no longer have this problem I managed to use another method of getting an exe file aka Pyinstaller.

Infacter
  • 11
  • 2
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 18 '21 at 04:02
  • I need to make a exe file that can run the program sound.py, but my current way isn't working so I need helping fixing this or using another method to make an exe file. Also my problem is that when I run it(the exe file in the build folder) it opens and closes and does nothing. – Infacter Oct 18 '21 at 04:59

0 Answers0