Python 3 and mpg321 formating
<p>Im having some problems playing a random sound using mpg321.
First I make a list of all the sounds and also store the length in a variable I then create a random number between 0 and the length of that list. My problem is I do not know how to add that to the string inside os.system() for the file path.</p>

<pre><code>sounds = os.listdir('./sounds/')  # creates list of all sound names
totalSounds = len(sounds)

sound_number = random.randint(0, len(sounds))
next_sound = str(sounds[sound_number])

soundPlaying = True
os.system('mpg321 ./sounds/%s') % next_sound
soundPlaying = False
</code></pre>

<p>I have tried using %s and putting the variable in after ./sounds/ but I get a syntax error saying os.system() only takes one argument.</p>

<p>Any help is appreciated.</p>