Skip to content

Instantly share code, notes, and snippets.

@XayOn
Created July 1, 2013 08:53
Show Gist options
  • Select an option

  • Save XayOn/5899373 to your computer and use it in GitHub Desktop.

Select an option

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

XayOn commented Jul 1, 2013

Copy link
Copy Markdown
Author

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