本文整理汇总了Python中threading.Thread.damon方法的典型用法代码示例。如果您正苦于以下问题:Python Thread.damon方法的具体用法?Python Thread.damon怎么用?Python Thread.damon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类threading.Thread
的用法示例。
在下文中一共展示了Thread.damon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from threading import Thread [as 别名]
# 或者: from threading.Thread import damon [as 别名]
if len(tmp_mps) == 1:
mp_obj_dict[notify_data["object_id"]].data_update(
tmp_mps[0])
else:
#TODO
pass
s.close()
notify_s.close()
if __name__ == "__main__":
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
dbus.mainloop.glib.threads_init()
gobject.threads_init()
bus = dbus.SystemBus()
base_name = dbus.service.BusName(BASE_IFACE, bus)
dbus_loop = gobject.MainLoop()
change_monitor_srv = Thread(target=change_monitor, args=[bus])
change_monitor_srv.damon = True
change_monitor_srv.start()
print("Zatel Dbus service is up and running...")
try:
dbus_loop.run()
except KeyboardInterrupt:
flag_quit = True
change_monitor_srv.join()
示例2: talkerNode
# 需要导入模块: from threading import Thread [as 别名]
# 或者: from threading.Thread import damon [as 别名]
}
landing_para = {'marks': ['r', 'g', 'b'],
'r': [0, 10],
'g': [60, 10],
'b': [120, 10],
'img_h': 240,
'img_w': 320,
'height_coeff': 18.7,
'x_coeff': 1,
'y_coeff': 1,
'c_pid': {'g': 0, 'p': 0.5, 'i': 0.0, 'd': 0.0, 'n': -1},
'xy_pid': {'g': 0, 'p': 0.4, 'i': 0.0, 'd': 0.0, 'n': -1},
'y_pid': {'g': 0, 'p': 0.4, 'i': 0.0, 'd': 0.0, 'n': -1},
'z_pid': {'g': 0.5, 'p': 0.6, 'i': 0.0, 'd': 0.0, 'n': -1}
}
if __name__ == '__main__':
global node
node = talkerNode(station_para, landing_para)
def stop_server(*args, **kwargs):
os.kill(os.getpid(), 9)
signal.signal(signal.SIGINT, stop_server)
server = Thread(target=httpserver)
server.damon = True
server.start()
#webbrowser.open('http://127.0.0.1:5000')
#app.run(host='0.0.0.0', port=5000, debug= True)
#worker = Thread(target=node.talk);worker.start()
#wserver.serve_forever()
node.talk()