尝试将此代码与以下代码绑定以创建进入程序的密码的困境
Dilemma trying to bind this code with the following code to make a password to enter program
代码:
print(Fore.CYAN +'Welcome To Manifest by Jysko#0420!')
print(Fore.LIGHTMAGENTA_EX, end='')
tools = '''Tools:
webchecker
portscanner
webhook spammer'''
print(Fore.LIGHTYELLOW_EX, end='')
print('TOOLS ARE CASE SENSITIVE!')
print(Fore.LIGHTMAGENTA_EX, end='')
print(tools)
secret_word = 'Blaze4'
guess = ''
print(Fore.YELLOW, end='')
guess = input('Enter Password: ')
try:
if guess != secret_word:
print(Fore.RED, end='')
error = print('ACCESS DENIED')
else:
print(Fore.GREEN, end='')
print('ACCESS GRANTED')
except:
print('')
#NEW CODE IS ABOVE!
def funt():
print(Fore.GREEN, end='')
tool = input('Enter Desired Tool: ')
print('')
if tool == 'webchecker':
try:
print(Fore.CYAN, end='')
site = input('Please Enter The Website Here: ')
response = requests.get(site)
requests.get(site)
if response.status_code == 200:
print('')
print(f'{Fore.GREEN}Online!')
sleep(1)
else:
print(f'{Fore.RED}Offline!')
sleep(1)
except:
print('')
else:
print(Fore.RED + 'Not A Tool!')
print('')
while True:
funt()
说 #NEW CODE ABOVE
的部分是我试图绑定在一起的部分。从 secret_word
开始,然后我尝试将其与 def funt():
开始的位置绑定。 'Bind' 我的意思是我想以工具菜单的方式创建一个菜单。我已经尝试了很多解决方案,当您输入错误的密码时仍然有问题仍然可以访问。我必须提到我正在学习编码。
在要求输入密码的代码周围放置一个 while
循环。输入正确的密码后,您将继续执行其余代码。
while True:
guess = input(Fore.YELLOW + 'Enter Password: ')
try:
if guess != secret_word:
print(Fore.RED + 'ACCESS DENIED')
else:
print(Fore.GREEN, end='')
print('ACCESS GRANTED')
break # leave the loop
except:
print('')
代码:
print(Fore.CYAN +'Welcome To Manifest by Jysko#0420!')
print(Fore.LIGHTMAGENTA_EX, end='')
tools = '''Tools:
webchecker
portscanner
webhook spammer'''
print(Fore.LIGHTYELLOW_EX, end='')
print('TOOLS ARE CASE SENSITIVE!')
print(Fore.LIGHTMAGENTA_EX, end='')
print(tools)
secret_word = 'Blaze4'
guess = ''
print(Fore.YELLOW, end='')
guess = input('Enter Password: ')
try:
if guess != secret_word:
print(Fore.RED, end='')
error = print('ACCESS DENIED')
else:
print(Fore.GREEN, end='')
print('ACCESS GRANTED')
except:
print('')
#NEW CODE IS ABOVE!
def funt():
print(Fore.GREEN, end='')
tool = input('Enter Desired Tool: ')
print('')
if tool == 'webchecker':
try:
print(Fore.CYAN, end='')
site = input('Please Enter The Website Here: ')
response = requests.get(site)
requests.get(site)
if response.status_code == 200:
print('')
print(f'{Fore.GREEN}Online!')
sleep(1)
else:
print(f'{Fore.RED}Offline!')
sleep(1)
except:
print('')
else:
print(Fore.RED + 'Not A Tool!')
print('')
while True:
funt()
说 #NEW CODE ABOVE
的部分是我试图绑定在一起的部分。从 secret_word
开始,然后我尝试将其与 def funt():
开始的位置绑定。 'Bind' 我的意思是我想以工具菜单的方式创建一个菜单。我已经尝试了很多解决方案,当您输入错误的密码时仍然有问题仍然可以访问。我必须提到我正在学习编码。
在要求输入密码的代码周围放置一个 while
循环。输入正确的密码后,您将继续执行其余代码。
while True:
guess = input(Fore.YELLOW + 'Enter Password: ')
try:
if guess != secret_word:
print(Fore.RED + 'ACCESS DENIED')
else:
print(Fore.GREEN, end='')
print('ACCESS GRANTED')
break # leave the loop
except:
print('')