标签:int exec read target def reading threading 传参 sel
python 多线程传参有点奇怪记录一下
import thread
sql1 = 'select 1'
sql2 = 'select 2'
def run(sql):
print sql
# 说明 target 后面是方法面 而参数要写在args里面并且要多一个逗号
if __name__ == '__main__':
t1 = threading.Thread(target=execute, args=(sql1,))
t2 = threading.Thread(target=execute, args=(sql2,))
t1.start()
t2.start()
标签:int exec read target def reading threading 传参 sel
原文地址:https://www.cnblogs.com/jiangxiaoxian/p/10583284.html