Files
intecsync/cgi-bin/galerie.py
Janek Schoffit ebba7bc34a chmod
2019-06-24 10:18:57 +02:00

54 lines
794 B
Python
Executable File

#!/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>
""")