Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- from os import environ
- import cgi
- import cgitb; cgitb.enable()
- form = cgi.FieldStorage() #pobiera wszystkie informacje wyslane za pomoca formularza
- dane1 = form.getvalue("dane1", "(no dane1)")
- dane2 = form.getvalue("dane2", "(no dane2)")
- def RepresentsInt(s):
- try:
- int(s)
- return True
- except ValueError:
- return False
- print "Content-Type: text/html"
- if RepresentsInt(dane1) and RepresentsInt(dane2):
- if dane1>dane2:
- print """\
- <p>Wieksza zmienna: %s</p>
- """ % (cgi.escape(dane1))
- if dane2>dane1:
- print """\
- <p>Wieksza zmienna: %s</p>
- """ % (cgi.escape(dane2))
- else:
- print """\
- <p>Wprowadzono bledne zmienne</p>
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement