import os
import random
def FindObjectsTable(a_dbcon, a_outputPath):
projectObjectsTableName = "objects"
for file in os.listdir(a_outputPath):
if file.endswith(".sgp"):
tableName = ("%s_objects" % file.replace(".sgp", "")).lower()
if TableExists(a_dbcon, tableName) == True:
projectObjectsTableName = tableName
return projectObjectsTableName
if __name__ == '__main__':
random.seed()
with open("daily.html", 'wb') as output:
output.write('<html>\n<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n <title>Art daily</title>\n')
output.write(' <style>\n html, body, #wrapper { height:100%; width: 100%; margin: 0; padding: 0; border: 0; }\n #wrapper td { vertical-align: middle; text-align: center; }\n </style>')
output.write('</head>\n<body bgcolor="black"><table id="wrapper">\n <tr><td><img src="./images/')
images = []
for root, dirs, files in os.walk(os.path.join(os.getcwd(), 'images')):
for f in files: images.append(f)
output.write('%s' % random.choice(images))
output.write('"/></td></tr>\n</table></body>\n</html>')