SwaroopPuli/retirement
0
1from flask import Flask, render_template_string2 3app = Flask(__name__)4 5HTML_TEMPLATE = '''6<!DOCTYPE html>7<html>8<head>9 <title>Retirement Invitations</title>10 <style>11 body {12 font-family: Arial, sans-serif;13 background: #f7f0e8;14 padding: 30px;15 }16 .invite {17 background: #fff;18 padding: 20px;19 margin: 20px auto;20 border-radius: 8px;21 width: 80%;22 box-shadow: 0 0 10px rgba(0,0,0,0.1);23 }24 h2 {25 color: #b36b00;26 }27 </style>28</head>29<body>30 <h1>Retirement Celebration Invitations</h1>31 {% for name, date, time, venue in invites %}32 <div class="invite">33 <h2>{{ name }}</h2>34 <p>๐
<strong>Date:</strong> {{ date }}</p>35 <p>๐ <strong>Time:</strong> {{ time }}</p>36 <p>๐ <strong>Venue:</strong> {{ venue }}</p>37 </div>38 {% endfor %}39</body>40</html>41'''42 43@app.route('/')44def home():45 invites = []46 with open('retirements.txt', 'r') as file:47 for line in file:48 parts = line.strip().split('|')49 if len(parts) == 4:50 invites.append(tuple(parts))51 return render_template_string(HTML_TEMPLATE, invites=invites)52 53if __name__ == '__main__':54 app.run(debug=True)