Last active
October 19, 2018 20:42
-
-
Save phi-line/03601e8f57a7f38c5b8f6261ed280958 to your computer and use it in GitHub Desktop.
Simple coin toss
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
| from subprocess import call | |
| from gtts import gTTS | |
| from random import randint, seed | |
| import os | |
| def flip(): | |
| text = ["It is heads", "It is tails"] | |
| return text[randint(0,1)] | |
| def main(): | |
| seed(None) | |
| tts = gTTS(text=flip(), lang='en') | |
| tts.save('flip.mp3') | |
| call(["vlc",'flip.mp3','--qt-start-minimized','--play-and-exit']) | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment