I have a folder that is my animation/game, and in the folder is the .pyw file and a .wav music file. I have
import wave
wave.open()
and I d
A common way this is done is by using the path of the current module, which is automatically available in the predefined__file__
variable, to determine the path to the file in the subdirectory:
import os
import wave
mydir = os.path.dirname(__file__)
subdir = 'sounds'
wavefilepath = os.path.join(mydir, subdir, 'Music.wav')
wave.open(wavefilepath)