Update galerie

This commit is contained in:
2019-06-03 16:10:09 +02:00
parent 9daadd17fe
commit 4bbf823199
2 changed files with 57 additions and 1 deletions

53
uebung6/galerie.py Normal file
View File

@@ -0,0 +1,53 @@
#!/usr/bin/python3
import cgi
import cgitb
import sys
from random import randint
cgitb.enable()
error = False
#try:
# # FieldStorage-Instanz erzeugen
# form = cgi.FieldStorage(encoding='utf8')
#
# # Zugriff auf die Parameter (nach Integer konvertieren!)
# s1 = int(form.getvalue('s1'))
# s2 = int(form.getvalue('s2'))
#
# # Summe berechnen
# my_sum = s1 + s2
#
#except:
# error = True
# Ausgabe
print("Content-type: text/html\n")
print("""
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>Summenrechner</title>
</head>
<body>
""")
randomnum = 3 * randint(1, 7)
count = 1
while count <= randomnum:
print(""" <img src="https://picsum.photos/800/600?random={}"> """.format(count))
count += 1
print("""
</body>
</html>
""")