From: Sam Moore Date: Thu, 16 May 2013 05:28:52 +0000 (+0800) Subject: Trying to make a cgi script... X-Git-Url: https://git.ucc.asn.au/?p=progcomp2013.git;a=commitdiff_plain;h=07c3aeca6b38ae0d83aa7e7c6ea197f50d10ed7c Trying to make a cgi script... --- diff --git a/web/web_qchess/qchess.py b/web/web_qchess/qchess.py new file mode 120000 index 0000000..35c6d6e --- /dev/null +++ b/web/web_qchess/qchess.py @@ -0,0 +1 @@ +../../qchess/qchess.py \ No newline at end of file diff --git a/web/web_qchess/web_qchess.py b/web/web_qchess/web_qchess.py new file mode 100644 index 0000000..c0513c1 --- /dev/null +++ b/web/web_qchess/web_qchess.py @@ -0,0 +1,16 @@ +#!/usr/bin/python + +import sys +import os +import cgi + + +if __name__ == "__main__": + form = cgi.FieldStorage() + x = int(form.getvalue("x")) + y = int(form.getvalue("y")) + + print "Content-type:text/html\r\n\r\n" + print "\n\nWebbified QChess\n\n" + print "

x = %d\ty = %d <\p>" % (x, y) + print "\n" \ No newline at end of file