Out of curiosity and trying to understand the subprocess module: Is it possible to do something like:
import subprocess
def myfun(arg):
# do stuff
arg = something;
p = subprocess.Popen(["myfun","arg"])
without putting "myfun" in a file of its own? It seems like this would in general be a scary thing to do if you are not careful about cleaning up child processes.