diff --git a/src/web/client/test_python.html b/src/web/client/test_python.html new file mode 100644 index 0000000..cabbb86 --- /dev/null +++ b/src/web/client/test_python.html @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + +

Data

+
+ + \ No newline at end of file diff --git a/src/web/python/chocomae/test_send_json_data.py b/src/web/python/chocomae/test_send_json_data.py new file mode 100644 index 0000000..d178420 --- /dev/null +++ b/src/web/python/chocomae/test_send_json_data.py @@ -0,0 +1,22 @@ +import CGIHTTPServer +import cgi +import os +print "Content-type: text/html" +print + +dir = os.path.dirname(os.path.realpath(__file__)) +form = cgi.FieldStorage() + +word = form["name"].value.upper() +word_len = len(word) +lines = open(dir+"\names.txt", "r").readlines() +names = [line.split()[0] for line in lines] +names.sort() + +names_to_return = [] + +for name in names: + if name[:word_len]==word: + names_to_return.append(name) + +print ', '.join(names_to_return) \ No newline at end of file