Python守护进程模式不返回信息
我在我的代码中使用了dameon模式,但我一点儿也不了解如何使用python守护进程Python守护进程模式不返回信息,python,python-3.x,database,Python,Python 3.x,Database,我在我的代码中使用了dameon模式,但我一点儿也不了解如何使用python守护进程 def get_data(): database = DB.connect("mydb.db") cur = database.cursor() sql_select_query = "SELECT * FROM data;" cursor.execute(sql_select_query, ) data = cursor.fetchall() cursor.cl
def get_data():
database = DB.connect("mydb.db")
cur = database.cursor()
sql_select_query = "SELECT * FROM data;"
cursor.execute(sql_select_query, )
data = cursor.fetchall()
cursor.close()
database.close()
return data
def run():
with daemon.DaemonContext():
print(get_data())
if __name__ == '__main__':
run()
当我运行我的文件时,它工作,但不返回任何东西,没有守护进程,它返回db table。请告诉我daemon的功能是什么?为什么我的代码不返回任何内容
提前谢谢你