Skip to content

Instantly share code, notes, and snippets.

@StephenBrown2
Last active August 11, 2020 20:11
Show Gist options
  • Save StephenBrown2/856cd35fc74fd454ad1b679ef6eaea2b to your computer and use it in GitHub Desktop.
Save StephenBrown2/856cd35fc74fd454ad1b679ef6eaea2b to your computer and use it in GitHub Desktop.
Random placeholder generator - python 3.6+
import random
placeholders = [
{'scheme': 'http', 'domain': 'placebeard.it', 'sep': '/'},
{'scheme': 'http', 'domain': 'placeskull.com', 'sep': '/'},
{'scheme': 'https', 'domain': 'dummyimage.com', 'sep': 'x'},
{'scheme': 'https', 'domain': 'placebear.com', 'sep': '/'},
{'scheme': 'https', 'domain': 'placekitten.com', 'sep': '/'}
]
for i in range(0, 10):
x = random.choice(range(100, 1001))
y = random.choice(range(100, 1001))
h = random.choice(placeholders)
print(f"{h['scheme']}://{h['domain']}/{x}{h['sep']}{y}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment