def main():
basic = BasicClass()
print('starting')
basic.start()
try:
while True:
time.sleep(0.5)
except KeyboardInterrupt:
pass
print('stopping threads')
basic.stop()
# wait for all threads to terminate
while threading.active_count() > 1:
time.sleep(0.1)
print('threads stopped')
sys.exit(0)
评论列表
文章目录