def takeUserInput(): name = user_input.get() letters = string.ascii_letters result_str = ''.join(random.choice(letters) for i in range(16)) print(result_str) Password.add_password(name, result_str) thePassword.set(result_str)