Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pysamples/speak.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pysamples/speak.py b/pysamples/speak.py
index 2a1f88c..594c296 100644
--- a/pysamples/speak.py
+++ b/pysamples/speak.py
@@ -32,8 +32,10 @@ def myblock(lc, x):
import os
- if type(x) == float:
- if int(x) == x:
- x = int(x)
+ # Turtle Art numbers are passed as float,
+ # but they may be integer values.
+ if type(x) == float and int(x) == x:
+ x = int(x)
+
os.system('espeak "%s" --stdout | aplay' % (x))