rot_13 / app.py
Hev832's picture
Update app.py
9d0591d verified
raw
history blame contribute delete
579 Bytes
import gradio as gr
import codecs
def rot13_cipher(text):
# Encode the text using ROT13
rot13_encoded = codecs.encode(text, 'rot_13')
# Decode the text using ROT13
rot13_decoded = codecs.decode(rot13_encoded, 'rot_13')
return rot13_encoded, rot13_decoded
# Gradio interface
iface = gr.Interface(
fn=rot13_cipher,
theme="Hev832/Applio",
inputs="text",
outputs=["text", "text"],
title="ROT13 Encoder/Decoder",
description="Enter text to see its ROT13 encoded and decoded versions."
)
# Launch the interface
iface.launch()