Created
June 7, 2021 17:59
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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