From a29012090331cd505090a52fe9c4da6508a799ef Mon Sep 17 00:00:00 2001 From: adb Date: Tue, 1 Sep 2020 19:26:56 +0000 Subject: [PATCH] Upload files to '' --- get_ip.py | 4 ++++ random_pw.py | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 get_ip.py create mode 100644 random_pw.py diff --git a/get_ip.py b/get_ip.py new file mode 100644 index 0000000..35cb71b --- /dev/null +++ b/get_ip.py @@ -0,0 +1,4 @@ +import socket + +inp = input('domain: ') +print(socket.gethostbyname(inp)) diff --git a/random_pw.py b/random_pw.py new file mode 100644 index 0000000..fea3dee --- /dev/null +++ b/random_pw.py @@ -0,0 +1,14 @@ +import random + + +def random_key(length): + characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' + return ''.join(random.choice(characters) for i in range(length)) + + +inp = input('password length: ') +if inp != '': + inp = int(inp) + print('your random password is:\n' + random_key(inp)) +else: + print('your random password is:\n' + random_key(8))