Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从一个文本文件一次打开Python(最好是Pydroid)中的多个/多个URL(网站)?_Python_File_Url_Text_Pydroid - Fatal编程技术网

如何从一个文本文件一次打开Python(最好是Pydroid)中的多个/多个URL(网站)?

如何从一个文本文件一次打开Python(最好是Pydroid)中的多个/多个URL(网站)?,python,file,url,text,pydroid,Python,File,Url,Text,Pydroid,我如何用Python编写一个程序,在Android上的同一个浏览器中,在文本文件中的新选项卡中打开许多网站(URL,或任何你想称之为URL的东西)?使用: import urllib f = open('links.txt','r') #considering each url in a new line... while True: URL = f.readline() if not URL: break mycontent=urllib

我如何用Python编写一个程序,在Android上的同一个浏览器中,在文本文件中的新选项卡中打开许多网站(URL,或任何你想称之为URL的东西)?使用:

import urllib
f = open('links.txt','r')
    #considering each url in a new line...
while True:
    URL = f.readline()
    if not URL:
        break
        mycontent=urllib.urlopen(URL).read()

当然,你文章中的缩进和你本地的非工作版本完全一样,对吗?