This python tutorial is for showing how to setup the web development environment under Ubuntu 11.10 and make hello world example.
So Python has become a hot word in recent years. But before you can do anything about it, you need a "hello world" sample application. In this tutorial, I will build a hello world Python web application under Ubuntu 11.10. All software versions are under Ubuntu 11.10's default setting.
1. Install Apache server. This is the HTTP server that will handle the request.
Try the following command and and open a browser and type "localhost", if server is up go to step 2.
If server is not running, use the following command to install:
2. Install mod_python. This is the module that is used to process .py files.
3. Configure Apache server. (If you configure PHP on Apache server, this is almost the same)
Even now you have installed mod_python in step 2, Apache server does not know how to handle .py files. We need to add a handler to
(you need to be in sudo mode to be able to edit "default" file!)
4. Write your "hello world" program.
def index(req): return "Hello World";
5. Restart Apache server and run your first Python web application.
You should be able to get your "hello world" web app correctly running.
You can now start exploring Python world, either by reading a book or google search!
<pre><code> String foo = "bar"; </code></pre>