Jan-22-2019, 04:20 PM
You can only go through a file object once. You do that on line 7 when you use the readlines method. So then on line 18 you read nothing, because you've already read the file.
I would suggest getting rid of urlcount and numberoflines, and looping over the file directly.
I would suggest getting rid of urlcount and numberoflines, and looping over the file directly.
with open('input.txt') as url_file: for my_url in url_file: uClient = uReq(my_url.strip()) ...
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures