I have been using Flask for a while and it's been a positive experience so far. It's simplicity helps you to get things done faster.<br>
<br><br><div class="gmail_quote">On Fri, Aug 10, 2012 at 8:35 AM, Lutz Horn <span dir="ltr"><<a href="mailto:lutz.horn@fastmail.fm" target="_blank">lutz.horn@fastmail.fm</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Smaran,<br>
<br>
Am Do, 9. Aug 2012, um 23:52, schrieb Smaran Harihar:<br>
<div class="im">> I am trying to create a simple cgi-script to receive a Ajax<br>
> call, manipulate the string received and send it back as JSON.<br>
<br>
</div>I can recommend bottle. The following example manipulates a JSON request<br>
body and returns it. That is *much* easier than using CGI.<br>
<br>
#!/usr/bin/env python<br>
<br>
from bottle import request, post, run<br>
<br>
@post('/hello')<br>
def index():<br>
    if request.headers.get('X-Requested-With') == 'XMLHttpRequest':<br>
        body = request.json<br>
        body["baz"] = "qux"<br>
        return body<br>
    else:<br>
        return 'This is a normal HTTP Post request.'<br>
<br>
run(host='localhost', port=8080)<br>
<span class="HOEnZb"><font color="#888888"><br>
Lutz<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br>