小试牛刀

网友投稿 353 2022-10-28


小试牛刀

#!/usr/bin/env python

# _*_ coding:utf-8 _*_

import datetime

import sys

import os

import urllib

import threading

import webbrowser

import time

def worker_open_blog():

print "start worker time:%s,and  threading pid is %s"% (time.time(),threading.current_thread())

url="s.getcode()

print "close web time:%s,and  threading pid is %s"% (time.time(),threading.current_thread())

gSem=threading._Semaphore(3)

def multhread_open_i in range(60):

s1=threading.Thread(target=worker_open_blog(),args=[gSem])

s1.start()

#os.system('taskkill /F /IM 360se.exe ') ##关闭360

if __name__=="__main__":

multhread_open_http()


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:shell
下一篇:Java并发编程之Semaphore的使用简介
相关文章

 发表评论

暂时没有评论,来抢沙发吧~