import thread | |
import time | |
def hello(name=''): | |
while 1: | |
time.sleep(2) | |
print "hello ", name | |
def main(): | |
thread.start_new_thread(hello, ('bob',)) | |
time.sleep(1) | |
thread.start_new_thread(hello, ('alice',)) | |
while 1: | |
name = raw_input('Please input your name:') | |
if name.strip(): thread.start_new_thread(hello, (name,)) | |
if __name__ == '__main__': | |
main() |
![]() |
1
AnyOfYou 2015-04-03 15:43:55 +08:00 ![]() Python 可以用 curses,https://docs.python.org/2/howto/curses.html
不清楚是不是你要的。 |
![]() |
3
gaocegege 2015-04-06 21:15:36 +08:00
0.0是怎么用github发代码的啊求指导Orz
|
![]() |
4
scola OP |