mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-27 14:01:09 +00:00
Merge pull request #37 from Renderer-RCT2/master
Add Random Password Generator
This commit is contained in:
commit
b2172fee7e
60
Random_Password_Generator/PasswordGenerator.py
Normal file
60
Random_Password_Generator/PasswordGenerator.py
Normal file
|
@ -0,0 +1,60 @@
|
|||
import random
|
||||
|
||||
chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()-=_+`~[]{]\|;:,<.>/?'
|
||||
|
||||
welcomeMessage = "Welcome to the Password Generator!"
|
||||
detailsMessage = "This program will generate a secure password using a random arrangement of letters (CAPS ON & caps off), numbers, and punctuations."
|
||||
creatorMessage = "Created by Professor Renderer on October 3rd, 2018."
|
||||
|
||||
print(welcomeMessage + '\n' + detailsMessage + '\n' + creatorMessage + '\n')
|
||||
|
||||
exitMessage = 0
|
||||
passwordGeneratorUsage = 1
|
||||
passwordGeneratorPrompt = 1
|
||||
|
||||
|
||||
while exitMessage != 1:
|
||||
|
||||
while passwordGeneratorUsage == 1:
|
||||
|
||||
passwordGeneratorPrompt = 1
|
||||
|
||||
passwordNum = input('How many passwords would you like to generate? ')
|
||||
passwordNum = int(passwordNum)
|
||||
|
||||
|
||||
passwordLength = input('How long will the password(s) be? ')
|
||||
passwordLength = int(passwordLength)
|
||||
|
||||
print('\n')
|
||||
print('Here are your password(s): \n')
|
||||
|
||||
passwordFile = open('Passwords.txt', 'w')
|
||||
for p in range(passwordNum):
|
||||
password = ''
|
||||
for c in range(passwordLength):
|
||||
password += random.choice(chars)
|
||||
print(password)
|
||||
passwordFile.write(password + '\n')
|
||||
passwordFile.close()
|
||||
print('\n')
|
||||
|
||||
while passwordGeneratorPrompt == 1:
|
||||
|
||||
getContinue = input('Do you want to use the Password Generator again? (Y/N)')
|
||||
print('\n')
|
||||
|
||||
if getContinue == "Y" or getContinue == "y":
|
||||
passwordGeneratorPrompt = 0
|
||||
print('\n')
|
||||
elif getContinue == "N" or getContinue == "n":
|
||||
exitMessage = 1
|
||||
passwordGeneratorUsage = 0
|
||||
passwordGeneratorPrompt = 0
|
||||
else:
|
||||
print("Please enter 'Y' or 'N.'\n")
|
||||
|
||||
|
||||
print('\n')
|
||||
print('Thank you for using the Password Generator. Have a nice day!')
|
||||
|
20
Random_Password_Generator/Passwords.txt
Normal file
20
Random_Password_Generator/Passwords.txt
Normal file
|
@ -0,0 +1,20 @@
|
|||
AaGhi>]!Tkz0{ik0S)mU<P@%6
|
||||
E|;>k7wuVdpSIkc:8V{q)e_*N
|
||||
!+B.C;YJ4+;/_$g>]FK/^vD]X
|
||||
I[dgz&|>uoh(K:-i;xgE:F!!C
|
||||
$Ab\ag_?lD57,L]Gf3(]j04aw
|
||||
nCC&RS7K]]GK(%pDHr,>fyv?[
|
||||
|VT3$kK5AGir))o9A6+ApR`%X
|
||||
:<Q/G13@Y2p4<rUz=Qj*^YSvZ
|
||||
kP3Hk.=\bhjnk]ILD6Ek)MQFH
|
||||
+wIXDLOl(I[8|NRaBw=J&iT^1
|
||||
wwly,3z;0X<-6kd>T<0],Kzm]
|
||||
XVp,+V.ko[c/-C3M22*+p@J3>
|
||||
zTR_S+lDuRn|MwGIVGFwu]pgH
|
||||
]p_8k1Z03$8]aJL@o^kY$#(Ez
|
||||
MGe:td4Ql~cZY&G.]u$IK){(p
|
||||
/&1>(jI|SEdg*L6$Zz,NfetZp
|
||||
1dN6clgIgi-EfIYB@cn>#^mix
|
||||
)cci)3*:0l$lNZ*Upi3ME?-C]
|
||||
<W2bM,E]PBQW%HE$sW1bwWDe!
|
||||
J^gQZ4.p%^|e>XC$#Rc*B+/Jr
|
20
Random_Password_Generator/README.md
Normal file
20
Random_Password_Generator/README.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Random Password Generator
|
||||
This program randomly generates a secure password using a mix of letters, both caps on and off, numbers, and punctuation, then outputs the results and saves them as a text document.
|
||||
|
||||
# Requirements
|
||||
|
||||
Python 3 and higher or Python 2 and higher
|
||||
|
||||
# Usage
|
||||
|
||||
For Windows users:
|
||||
|
||||
```bash
|
||||
$ python PasswordGenerator.py
|
||||
```
|
||||
|
||||
For Mac/Linux/Unix users:
|
||||
|
||||
```bash
|
||||
$ ./PasswordGenerator.py
|
||||
```
|
Loading…
Reference in New Issue
Block a user