擅长:python、mysql、java
<p>可以使用<a href="https://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files" rel="nofollow">open</a>读取<code>.txt</code>文件。例如:</p>
<pre><code>import urllib
f = open('list.txt')
for l in f:
try:
#for python3.x use: x= urllib.request.urlopen('http://'+l)
x= urllib.urlopen('http://'+l)
except:
print ('not found')
else:
print (x.readlines())
</code></pre>