Created
September 15, 2018 15:38
-
-
Save wannaphong/cf1bfcdced5f224eb790f084ff954ba6 to your computer and use it in GitHub Desktop.
This file contains 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
import sys | |
from subprocess import call | |
def play(name): | |
if sys.platform == 'linux': | |
call(["ffplay",name]) | |
elif sys.platform == 'darwin': | |
call(["afplay",name]) | |
elif sys.platform == 'win32': | |
call(['start',name]) | |
else: | |
print('error : ',name) | |
play("ไฟล์.mp3") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment