37,719
社区成员
发帖
与我相关
我的任务
分享
import webbrowser as web
import time
import os
import random
count=random.randint(2,5)
j=0
while j<count:
i=0
while i<=6:
web.open_new_tab("http://www.baidu.com")
i+=1
time.sleep(1.0)
else:
os.sys('taskkill /f /im firefox.exe')
print j,'times closing browser'
j+=1
import webbrowser as web
import time
import os
import random
count = random.randint(2,5)
j = 0
while j < count:
i = 0
while i <= 6:
web.open_new_tab(“http://blog.sina.com.cn/s/blog_aefb7d2f0102v761.html”)
i= i + 1
time.sleep(1.0)
else:
os.sys('taskkill /f /im firefox.exe')
print j,'times closeing browser'
j = j + 1
输入python代码的时候注意缩进,另外是大小写字母的问题,“While”和“Web”首字母均不是大写