Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 101627

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability. Use the python tag for all Python related questions. If you believe your question may be even more specific, you can include a version specific tag such as python-3.x.

1 vote
2 answers
20k views

Loop through a list of URLs multi-threading and check return code in python

I have to loop through a list of over 4000 urls and check their http return code in python. Url.txt: Contains a list of 4000 urls with one url per line. … /usr/bin/python # To just check a site and get the URL code #import urllib.request #print(urllib.request.urlopen("http://www.stackoverflow.com").getcode()) ############################################ …
Stryker's user avatar
  • 133
2 votes

Loop through a list of URLs multi-threading and check return code in python

Here is what I decided to change the code to this version, which runs a lot faster: import urllib.request import urllib.error import time from multiprocessing import Pool start = time.time() file = …
Stryker's user avatar
  • 133