wostner.cardimgtab(rank='Q', suit='H') </pre> """ # UNCOMMENT THESE: # import games # This will give you the whole poker deck. # d['mysandbox']= str(games.poker.DECK) # Deal only five cards for a poker game. # d['mysandbox']= str(games.poker.deal()) from wostner import filemod # The line below has been improved. d['lastmod'] = "{:%F at %H:%M}".format(filemod(__file__)) SANDBOX_TEMPLATE = """ <p>The natural order of the suits is alphabetic: C, D, H, S: ♣ ♦ ♥ ♠ </p> <p>Unsorted poker hand: </p> {} <p>Same hand sorted by rank only: </p> {} <p>Original hand sorted by suit only : </p> {} <p>Original hand sorted by rank and suit : </p> {} """
# DO NOT EDIT ANY OF THE LINES ABOVE # ----------------------------------------------- # The webpage has a form object. form = cgi.FieldStorage() from mydatabases.olympicslite import DB # Populate a dictionary d with values to be used in our webpage template. d = dict() d["mystylesheet"] = "mystyle.css" d["database"] = DB d["create_medals_table"] = mydatabases.olympicslite.CREATE_MEDALS_TABLE d["sample_queries"] = mydatabases.olympicslite.SAMPLE_QUERIES d["sample_queries"] = wostner.list2html(d["sample_queries"]) d["default_query"] = "SELECT * FROM Medals" d["myquery"] = form.getvalue("myquery") if form else d["default_query"] d["logo"] = "sqlite_editor_logo.png" #'sqlite_logo.png' d["lastmod"] = "{:%F at %H:%M}".format(wostner.filemod(__file__)) d["myname"] = "Julie Ahn" d["myresult"] = mydatabases.myquerytools.sql2dicts(d["myquery"], DB) d["myresult"] = wostner.dicts2table(d["myresult"], table_css_class="data") print(mydatabases.mytemplates.QUERY_PAGE_TEMPLATE.format(**d)) # End of file.