- #! /usr/bin/env python
- #coding=utf-8
- # AQQ批量网站工具集之调用浏览器打开URL列表
- import webbrowser
- import time
- print u'请输入文件名:'.encode('gb2312')
- URLname = raw_input()
- # attempt to open file for reading
- try:
- fobj = open(URLname,'r')
- except:
- print '*** file open error,Please check filename and try again!'
- else:
- i = 0
- for eachUrl in fobj:
- eachUrl = eachUrl.strip()
- webbrowser.open(eachUrl)
- time.sleep(2) #jiange shijian
- i = i + 1
- if i % 5 == 0: # each open url num
- raw_input("No %d " % i)
- #该片段来自于http://www.codesnippet.cn/detail/2105201512626.html
来源: http://www.codesnippet.cn/detail/2105201512626.html