python和sh的多线程
sh :
#!/bin/bash
for i in 1 2 3 4 5 6 7 8 9 10
do
wget -O /dev/null &
done
python:
#!/usr/bin/python
import os
from threading import *
class wget_cla(Thread) :
def __init__(self):
Thread.__init__(self)
def run(self):
cmd = 'wget -O /dev/null
os.system(cmd)
if __name__ == '__main__' :
for i in range(100):
wget = wget_cla()
wget.start()
阅读(849) | 评论(0) | 转发(0) |