Untitled

                Never    
from tkinter import *
import pyperclip

def update_btn():
    global some_entry
    pyperclip.copy(some_entry.get())

def update_btn_2():
    global some_entry
    some_entry.insert(END, pyperclip.paste())


def algorithm(event = 0):
    global data, type
    alphabet_rus_full = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ"
    encrypted = []
    encrypt = cesar_input.get().upper()
    if key_input.get() != "":
        key = int(key_input.get())
    else:
        key = ""
    if encrypt != "" and key != "" and type.get() == "code":
        for i in range(len(encrypt)):
            if encrypt[i] != " ":
                encrypted.append(alphabet_rus_full[alphabet_rus_full.find(encrypt[i])+key])
        data["text"] = ''.join(encrypted)
    elif encrypt != "" and key != "" and type.get() == "decode":
        for i in range(len(encrypt)):
            if encrypt[i] != " ":
                encrypted.append(alphabet_rus_full[alphabet_rus_full.find(encrypt[i])-key])
        data["text"] = ''.join(encrypted)
    else:
        data["text"] = "У тебя там данных нет, Вася"

window = Tk()
window.title("Шифрование методом Цезаря")
window.geometry("410x90")

welcome_txt = Label(window, text="Цезарь")
welcome_txt.grid(row=0, column=0)

cesar_input = Entry(window, width=50)
cesar_input.grid(row=1, column=0)
cesar_input.bind('<Return>', algorithm)

keyLabel = Label(window, text="Ключик")
keyLabel.grid(row=0, column=1)
keyLabel.bind('<Return>', algorithm)

data = Label(window, text="Ждем")
data.grid(row=3, column=0)

key_input = Entry(window, width=5)
key_input.grid(row=1, column=1)

btn_ready = Button(window, text="Цезеруйте!", width=15, command=algorithm)
btn_ready.grid(row=2, column=0)

type = StringVar()
type.set("code")
crypt_btn = Radiobutton(window, text="Шифруем", value="code", variable=type)
crypt_btn.grid(row=2, column=1)
decrypt_btn = Radiobutton(window, text="Дешифруем", value="decode", variable=type)
decrypt_btn.grid(row=3, column=1)


window.mainloop()

Raw Text