Created
June 16, 2023 16:41
-
-
Save fellipec/3ae649138d9af75c9e9122560df81646 to your computer and use it in GitHub Desktop.
Sinal musical aleatório
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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