1 Star 3 Fork 2

Tosobright / BackGroundCollectProgram

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
MainThread.py 667 Bytes
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
toso tao 提交于 2017-02-18 15:43 . First
__author__ = 'Toso'
import threading
import TcpListen
import MySQL
import misc
exitFlag = 0
def SaveDataToSQL():
data=''
while exitFlag == 0:
if not TcpListen.TcpQueue.empty():
data=TcpListen.TcpQueue.get()
MySQL.MySQLData(data)
misc.print_time('------SaveDataToSQL_'+data+'------',1)
else:
misc.print_time('SQL_Thread',1)
def Thread2():
while exitFlag == 0:
misc.print_time('Thread2',1)
thread1 = threading.Thread(target=SaveDataToSQL,args=())
thread2 = threading.Thread(target=Thread2,args=())
thread1.start()
thread2.start()
TcpListen.tcplisten()
print "Exiting Main Thread"
Python
1
https://gitee.com/tosobright/BackGroundCollectProgram.git
git@gitee.com:tosobright/BackGroundCollectProgram.git
tosobright
BackGroundCollectProgram
BackGroundCollectProgram
master

搜索帮助