Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating an executable
#9
My script file has the following:
=================================
img_folder = 'alpha\\english\\'
eng_audio_folder = 'alpha\\english\\audio\\'
.....
Later, in my script, as part of a list definition:
pygame.image.load(resource_path(img_folder + "q.png")), pygame.image.load(resource_path(img_folder + "r.png")),
.....
I also define the following function:
def pronounce(a):
soundfile = resource_path(eng_audio_folder + a + '.wav')
pygame.mixer.music.load(soundfile)
pygame.mixer.music.play(-1)
time.sleep(1.6)
return
.....
Inside another function:
pygame.mixer.music.load(resource_path(eng_audio_folder + "Birdcall.mp3"))
pygame.mixer.music.play(-1)
=================================
Everything works fine when I run the script from Pycharm.
I can successfully create an executable file w/ simpler Python scripts,
where it doesn't use image files and/or audio files.

Isn't that relative coding? I don't use "C:\ ...." for my directories.
Also, how do I add the mp3 file to the spec file?
Should I convert it to a .wav file?

I'll try to modify the PATHEX parameter in the spec file later today.

Thanks.
Reply


Messages In This Thread
Creating an executable - by vman44 - Apr-02-2020, 04:26 AM
RE: Creating an executable - by buran - Apr-02-2020, 04:46 AM
RE: Creating an executable - by vman44 - Apr-02-2020, 05:36 PM
RE: Creating an executable - by buran - Apr-02-2020, 06:11 PM
RE: Creating an executable - by vman44 - Apr-15-2020, 05:54 PM
RE: Creating an executable - by buran - Apr-15-2020, 06:02 PM
RE: Creating an executable - by vman44 - Apr-19-2020, 12:29 AM
RE: Creating an executable - by buran - Apr-19-2020, 07:56 AM
RE: Creating an executable - by vman44 - Apr-19-2020, 08:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Creating an executable from a script wolf8963 6 5,855 May-11-2020, 05:23 PM
Last Post: wolf8963

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020