Created
July 1, 2013 08:53
-
-
Save XayOn/5899373 to your computer and use it in GitHub Desktop.
Export a proxy property on a class wich gets a random proxy from a proxies.txt file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@property | |
def proxy(self): | |
with open('proxies.txt') as proxy_file: | |
return choice(proxy_file.readlines()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dont forget to have choice imported
from random import choice