Skip to content

Instantly share code, notes, and snippets.

@AHilyard
Created March 22, 2017 16:35
Show Gist options
  • Save AHilyard/1a0d55cc519b75837c0b9f98beefb15d to your computer and use it in GitHub Desktop.
Save AHilyard/1a0d55cc519b75837c0b9f98beefb15d to your computer and use it in GitHub Desktop.
A very simple Python script to generate Xcode storyboard file IDs.
#!/usr/bin/python
import string
import random
def get_random_character(input):
if input == 'X':
all_characters = string.ascii_letters + string.digits
return random.choice(all_characters)
else:
return input
def main():
id_template = "XXX-XX-XXX"
print ''.join([get_random_character(x) for x in id_template])
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment