Skip to content

Instantly share code, notes, and snippets.

@XayOn
Created July 1, 2013 08:53
Show Gist options
  • Save XayOn/5899373 to your computer and use it in GitHub Desktop.
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.
@property
def proxy(self):
with open('proxies.txt') as proxy_file:
return choice(proxy_file.readlines())
@XayOn
Copy link
Author

XayOn commented Jul 1, 2013

Dont forget to have choice imported
from random import choice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment