Commits

Anonymous committed 8edbdc0

better safe_input

  • Participants
  • Parent commits 8aa1415

Comments (0)

Files changed (1)

 def safe_float_input(s):
     while 1:
         r = raw_input(s)
+        if len(r) == 0:
+            continue
         if r[0].isdigit() or r[0]=='.':
             res = float(r)
             return res
     ts = np.linspace(0,200.0, 10000)
     
     
-    N = np.random.random_integers(1,11)
+    N = np.random.random_integers(1,7)
     print "Making a figure with %d hypocycloids..." % N
     pyplot.figure()
     for ii in range(N):
         # pyplot.plot(xs,ys, aspect=1.0) # not right so set below
         ax=pyplot.axes()
         ax.set_aspect('equal', 'datalim')
-    pyplot.show()
+