Skip to content

Instantly share code, notes, and snippets.

@david-wm-sanders
Created February 20, 2016 02:08
Show Gist options
  • Save david-wm-sanders/501d0fe89705b80da9ac to your computer and use it in GitHub Desktop.
Save david-wm-sanders/501d0fe89705b80da9ac to your computer and use it in GitHub Desktop.
Single draft from the list in heroes.txt
#!/usr/bin/env python3
import random
with open("heroes.txt", "r") as f:
heroes = f.read().splitlines()
draft = random.sample(heroes, 3)
print(*draft, sep=", ")
@david-wm-sanders
Copy link
Author

heroes.txt Example:

Earthshaker
Omniknight
Phoenix
Sand King
Tidehunter
Undying
Vengeful Spirit
Venomancer
Viper
Ancient Apparition
Bane
Crystal Maiden
Dazzle
Disruptor
Jakiro
Keeper of the Light
Lich
Lina
Lion
Ogre Magi
Pugna
Shadow Demon
Shadow Shaman
Silencer
Skywrath Mage
Warlock
Windranger
Winter Wyvern
Witch Doctor

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