Python

SimpleHTTPServer

$ python -m SimpleHTTPServer 8080

pip

Install pip

$ python get-pip.py

Uninstall pip

$ python -m pip uninstall pip setuptools

Installing the requirements

# In order to keep your environment consistent, “freeze” the current state of the environment packages.
$ pip freeze > requirements.txt

# Install all the packages in the current environment, and their respective versions
$ pip install -r requirements.txt

virtualenv

Install virtualenv

$ pip install virtualenv

Create virtual environment

$ cd project_name
$ virtualenv env

Activate the corresponding environment

$ . env/bin/activate

If you want to go back to the real world, use the following command

$ deactivate

Hello World in Python on Apache

Create hello.py with this content:

1
2
3
4
5
#! /usr/bin/python

print "Content-type: text/html"
print ""
print "Hello, World!"

and make it executable:

$ chmod +x hello.py

and dropped this .htaccess:

Options +ExecCGI
AddHandler cgi-script .py