Skip to content

Instantly share code, notes, and snippets.

@wannaphong
Created September 15, 2018 15:38
Show Gist options
  • Select an option

  • Save wannaphong/cf1bfcdced5f224eb790f084ff954ba6 to your computer and use it in GitHub Desktop.

Select an option

Save wannaphong/cf1bfcdced5f224eb790f084ff954ba6 to your computer and use it in GitHub Desktop.
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