Basically I wanted to start a daemon in the background that will still prompt the user in the console for a password. I created this with pexpect, but when this program ends it kills the daemon since it is a child process. So obviously pexpect isn't going to work for this. Does any body know of a way to do this?
#!/usr/bin/env python
import pexpect
import getpass
child = pexpect.spawn('python daemon.py &')
child.expect_exact('Password:')
passwd = getpass.getpass()
child.sendline(passwd)
index = child.expect_exact('Started Successfully')
print index