基本信息
源码名称:多线程socket编程
源码大小:6.65KB
文件格式:.rar
开发语言:Python
更新时间:2016-09-17
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍
可以socket实现客户端向服务器发送数据

import thread







print "ts1 run"
import os,time
import ts4
import ts4a
import server
print"红旗!!!"


#from ts3 import MyBaseRequestHandlerr

def serverclient(str,no):
while no<3:
print "开始运行模块: %s    start at:  %s\n" %(str,time.ctime(time.time()))
#print "%s %s\n" % ( time.ctime(time.time()),str )
#os.startfile(r"E:\Linux下载\Python-information\python-code\并行\ts1.py")
#time.ctime(time.time()
#exec 'execfile("E:\Linux下载\Python-information\python-code\ts1.py")'
#exec 'import %s'%(str)

print "%s 第:%d  次监听!!! at   %s    \n\n " %(str,no,time.ctime(time.time()))
exec '%s.git()'%(str)
no =1
time.sleep(no)





def run():
try:
print "start_new  unaboe!!!"    
thread.start_new_thread( serverclient, ("server",1) )
thread.start_new_thread( serverclient, ("ts4a",1) )
except:
print "Error unaboe!!!"



if __name__=='__main__':
print "222"
run()

while 1:
pass
#os.startfile(r"E:\Linux下载\Python-information\python-code\并行\ts1.py")

#os.startfile(r"E:\Linux下载\Python-information\python-code\并行\ts2.py")

print('task done.')