current
All checks were successful
test / build-docs (push) Successful in -19s

This commit is contained in:
2025-07-10 21:03:06 +02:00
parent 11a0aa2d89
commit a692ac8b05
19 changed files with 3931 additions and 28 deletions

32
create_ps/create_ps.py Executable file
View File

@@ -0,0 +1,32 @@
#! /usr/bin/env python
import string
import secrets
def create_password(long=int(10), sonder="!#$%&()*+-/:;<=>?@[]_{|}"):
print("Sonderzeichen:", sonder)
alle = string.ascii_letters + string.digits + sonder
while True:
tx = ""
anz = [0, 0, 0, 0]
for i in range(long):
zeichen = secrets.choice(alle)
tx += zeichen
if zeichen in string.ascii_lowercase:
anz[0] += 1
elif zeichen in string.ascii_uppercase:
anz[1] += 1
elif zeichen in string.digits:
anz[2] += 1
else:
anz[3] += 1
# print("Anzahl:", anz)
if 0 not in anz:
break
return tx
if __name__ == "__main__":
print(create_password(long=20))