Last active
November 16, 2015 07:19
-
-
Save mustafaxfe/5c7f22ba9de5e7c82638 to your computer and use it in GitHub Desktop.
Hi, I updated my Python script to use it for some sites that accepts just letters, and numbers. You can use it while sing up... It is written by Mustafa Sarialp and its licence Public Domain.
This file contains 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
#!/usr/bin/env python3 | |
# ==================================================================================================================================================== | |
# Name : create_password.py | |
# Author : Mustafa Sarialp | |
# Version : 2.0.2 | |
# Copyright : Public Domain | |
# Description : Updated version of my Python 3 script "create_password" which you can create a password without special charecters for using with some | |
# web sites which don't support special characters like "#, &, %, !, ...". This script creates simpler passwords than version 1.0. | |
# ==================================================================================================================================================== | |
import random | |
def create_password(): | |
password = [] | |
new_password = '' | |
letters = 'abcdefghijklmnopqrstuvwxyz' | |
for i in range(12): | |
letter = random.choice(letters) | |
number = random.randrange(0, 10, 1) | |
if i % 3 == 0: | |
if i / 3 > 2: | |
password.append(letter.capitalize()) | |
else: | |
password.append(letter) | |
elif i % 2 == 0: | |
password.append(str(number)) | |
else: | |
if i % 4 == 0: | |
password.append(str(num)) | |
else: | |
if i / 4 > 1: | |
password.append(letter.capitalize()) | |
else: | |
password.append(letter) | |
random.shuffle(password) | |
new_password += random.choice(letters) | |
for j in range(12): | |
new_password += password.pop() | |
return new_password | |
if __name__ == '__main__': | |
key = '' | |
while key != 'q': | |
my_passwd = create_password() | |
print("You can use: ", my_passwd, " as creating normal password.") | |
key = input("To create new one press 'c' or to quit press 'q': ") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment