这代码不是我自己写的,我是看视频写的。我也不知道算不算是原创,只能说放在这里做个记录,以后自己看了方便。
# coding:utf-8
import webbrowser as web
import time
import os
import random
count = random.randint(2,4)
j = 0
while j < count:
i = 0
while i <= 5:
web.open_new_tab('http://www.baidu.com')
i = i + 1
time.sleep(1)
else:
os.system('taskkill /F /IM iexplore.exe')
print j, 'times closint '