我一直在尝试制作加密和解密系统,但我遇到了一个小错误.这是我的代码:
import sys
import pyperclip
def copy(data):
question = input("Copy to clipboard? ")
if question.lower() == 'yes' or question.lower() == 'y':
pyperclip.copy(data)
print("Encrypted message copied to clipboard.")
rerun()
elif question.lower() == 'no' or question.lower() == 'n':
rerun()
else:
print("You did not enter a valid input.")
copy(data)
def rerun():
ask = input("\nWould you like to run this program again? ")
if ask.lower() == "yes" or ask.lower() == "y":
print(" ")
run()
elif ask.lower() == 'no' or ask.lower() == 'n':
sys.exit("\nThank you!") …Run Code Online (Sandbox Code Playgroud)