Skip to content

Instantly share code, notes, and snippets.

@puzzlepeaches
Created June 7, 2021 17:59
Show Gist options
  • Save puzzlepeaches/ce1ff11ddacd23eccc45ad2ce8a85d6e to your computer and use it in GitHub Desktop.
Save puzzlepeaches/ce1ff11ddacd23eccc45ad2ce8a85d6e to your computer and use it in GitHub Desktop.
Really bad way of adding a letter after the first character in a username. Makes username validation a little easier if your client is using the format {f}{m}{last}@acme.com.
# Usage: python3 usergen.py -f users.txt | tee modified-users.txt
import string
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--file", "-f", type=str, required=True)
args = parser.parse_args()
file = open(args.file, "r")
for user in file:
for letter in string.ascii_lowercase:
modified = user[:1] + letter + user[1:]
username = modified.rstrip()
print(username)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment