Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)

I want to check how python works in website development. I've just written this, which works:

#!/usr/bin/python

def main():

    print "Content-type: text/html"

    print

    print "<html><head>"

    print "<title>Hello World from Python</title>"

    print "</head><body>"

    print "Hello World!"

    print "</body></html>"

if __name__ == "__main__":

    main()

Without using Django, what's the best way to write scripts that can process get and post?

1 Answer

0 votes
by (108k points)

I think you are looking for the CGI module. It is basically a part of the Python standard library. Free functionality is available in urllib and urllib2. You can also check out BaseHTTPServer and SimpleHTTPServer, which are also part of the standard library.

Here is one package wsgiref that will give you the basics of a WSGI interface, same as web.py, Django, Pylons, CherryPy, etc, as others have mentioned.

Looking for a Python Tutorial? Join Intellipaat's Python Course to gain more knowledge on Python.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Oct 11, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...