from flask import Flask, request, render_template_string app = Flask(__name__) cipher_map = { '€':'q', '$':'w', '‘':'e', '“':'r', '>':'t', '<':'y', '|':'u', ';':'i', '\\':'o', '_':'p', '=':'a', '+':'s', '*':'d', '^':'f', '%':'g', '#':'h', '}':'j', '{':'k', ']':'ー', '[':'z', '.':'v', ',':'b', '?':'n', '!':'n', '・':'m' } def decode_cipher(cipher_text): romaji = '' for char in cipher_text: if char in cipher_map: romaji += cipher_map[char] else: romaji += char return romaji # --- HTMLデザイン(シンプル) --- HTML = """ 暗号デコーダー

暗号デコーダー


{% if decoded %}
ローマ字解読結果: {{decoded}}
{% endif %} """ @app.route("/", methods=["GET", "POST"]) def index(): decoded = "" cipher = "" if request.method == "POST": cipher = request.form.get("cipher", "") decoded = decode_cipher(cipher) return render_template_string(HTML, cipher=cipher, decoded=decoded) if __name__ == "__main__": app.run(debug=True)