The simplest way to do this is place this in /etc/init/something.conf:
start on runlevel [2345]
stop on runlevel [016]
respawn
exec python /path/to/your/script.py
Respawn will start it back up if it is killed or exits non-zero (like an uncaught exception). This will work going back to Ubuntu 10.04.
If you have 12.04 you can get more fancy. The above will run your script as root. In 12.04 you can add setuid/setgid:
start on runlevel [2345]
stop on runlevel [016]
respawn
setuid nobody
setgid nogroup
exec python /path/to/your/python.py
If your script exits when there is no network available and you plan to run it on an unstable network connection, well, you should fix that and just make it stay alive/retry. But if you can't, you may also need to have it manually started whenever a network device comes up. So you can place this in /etc/network/if-up.d/yourscript (make it executable with chmod +x)
#!/bin/sh
exec start wait-for-state WAITER=$IFACE-yourscript WAIT_FOR=something
Where yourscript is just something arbitrary and unique to this particular script, and "something" is the same as the job name (such as the /etc/init/something.conf suggested earlier).