[Tutor] Is there a library which has this object?

Yeh yeh at whoosh.cn
Sat Apr 30 03:48:59 EDT 2016


 > You need to post in plain text otherwise the mail system mangles your
 > code, as you can see.

I'm sorry for it. :(

my code is:

import time
import numpy as np

start = input("please input the value of start: ")
end = input("please input the value of end: ")
dur = input("please input the value of dur: ")
array = np.linspace(float(start),float(end),1000)
dur = float(dur)/len(array)
for i in array:
print(float(i))
time.sleep(dur)

and it worked, then, I was trying to make it as a function:

def myFunction(start,end,dur):
...........
for i in array:
return i
time.sleep(dur)

there is no errors. because it just post the first number in the array, even I change the order of time.sleep() and return.

I have checked the cycle(), and yes, that is what I'm searching! But, I got an other question, how to stop cycle() by manual?
such as press "q", then break the cycle(). and has same question to make it be a function.

Thanks
Yeh Z
 		 	   		  



More information about the Tutor mailing list