Although nohup will work, it is a quick and dirty solution. To create the proper daemon process, you need to use SysV init or (if you are using Ubuntu 6.10+ or ββFedora 9+).
Here is a simple script that runs a.py and restarts it whenever it gets killed (up to 5 times in 5 minutes):
respawn
respawn limit 5 300
exec python /path/to/a.py
Then just put this script in /etc/init/.
Upstart . .