#!/usr/bin/env python import cgi import json # Worse code here. Prepare your eyes for this monster. # Its almost as bad as programming anything in php or even worse javascript. print('Content-Type: text/html') def create_blahaj_tables(): try: tables_html = """

Blahaj list!!!!!

Submit yours here if you haven't already!

Back to blahaj room


""" with open("blahaj_info.json", "r") as fp: blahaj_list = json.load(fp) for blahaj in blahaj_list: current_table = """

put_name_here

Date submitted: put_date_here

put_info_here

""" current_table = current_table.replace("put_name_here", blahaj["name"]) current_table = current_table.replace("put_info_here", blahaj["info"]) current_table = current_table.replace("put_date_here", blahaj["date"]) tables_html += current_table return tables_html except FileNotFoundError: # No blahaj's yet return """

No blahaj's found ):

Yours could be first tho :3

Submit yours here

""" html_text = """ hehehe
thing_to_replace
""" tables = create_blahaj_tables() html_text = html_text.replace("thing_to_replace", tables) print(html_text)