To execute a program asynchronously from Python, you can use the Popen function as shown here:
import subprocess
# ...
pid = subprocess.Popen(["/usr/bin/python2.7", "res.py"]).pid
That said, if you are invoking something over and over again, you probably want to use cron (all UNIX variants, including Linux and Mac OS X) or launchd (Mac OS X). You can create a cron job by invoking the command crontab -e
and then adding a line such as the following (the asterisks below mean "each" and correspond to minutes, hours, days of the month, months, and days of the week):
* * * * * /usr/bin/python2.7 script_to_execute.py >/dev/null 2>&1
The line above will run "script_to_execute.py" every minute. You can see some of the examples on the cron Wikipedia page for specifying different intervals at which a script should run.