Created
June 6, 2015 19:54
-
-
Save SpaceVoyager/9de54d26a258434c3a49 to your computer and use it in GitHub Desktop.
hello.py
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
| # An more interesting Pyhthonista 'Hello World' program | |
| # Written by Yuhang Wang for A2PyKids | |
| import console | |
| import canvas | |
| from random import random | |
| import speech | |
| # Ask for your name and then write it in random color on screen | |
| canvas.set_size(1000, 600) | |
| canvas.set_fill_color(random(), random(), random()) | |
| input = console.input_alert('What is your name?') | |
| text = 'Hello, ' + input + '!' | |
| size = 100 | |
| fnt = 'Helvetica-Bold' | |
| canvas.draw_text(text, 10, 200, fnt, size) | |
| # Also let Siri speak it out | |
| speech.say(text, 'en-US', 0.3) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We are awesome