From 363950e62d11949cf16609df30a7f8877b42810a Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 23 Feb 2011 13:15:08 +0000 Subject: code cleanup --- 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)) -- cgit v0.9.1