Skip to content

Instantly share code, notes, and snippets.

@fellipec
Created June 16, 2023 16:41
Show Gist options
  • Save fellipec/3ae649138d9af75c9e9122560df81646 to your computer and use it in GitHub Desktop.
Save fellipec/3ae649138d9af75c9e9122560df81646 to your computer and use it in GitHub Desktop.
Sinal musical aleatório
#!/usr/bin/python3
import os
import random
import subprocess
diretorio = "sinal/"
arquivos = os.listdir(diretorio)
arquivo_aleatorio = random.choice(arquivos)
subprocess.run(["mpg123", os.path.join(diretorio, arquivo_aleatorio)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment