Python 多进程使用之监控
'''从文件或数据库中获取需要监控的网页地址'''def get_url_list(value):
if value == '':
print '该函数需要指定一个参数!'
return
if value == 'file':
file_path='C:\urllist.txt' #文本中的数据一行一条
try:
f=open(file_path, 'r')
except Exception,e:
print e
else:
return f.readlines()
elif value == 'mysql':
pass
else:
print '传入值错误!'
print '该函数只接收 file、mysql参数'
页:
[1]