I have a script (A.py) that will spawn new processes (B.py) dynamically but those scripts need to be created as root.  If I run 
$ python A.py
as a normal user, then when I run
>>> subprocess.Popen('sudo nohup python B.py &') 
I'll need to enter the root password to start.  I don't really want to do that.
Now if I run the first script as root
$ sudo python A.py
then I'll be able to run
>>> subprocess.Popen('nohup python B.py &')
like normal.  The thing that concerns me is a timeout period with the sudo and it will drop to normal privileges then when A.py want to spawn/kill a process it will ask for a password and stop working as intended.
- Will running sudo python A.pykeep root privileges for the life of the script, or will it lose it with thesudo timeout(I believe default is 15min) like a normal terminal?
- Is there a better way of doing this?

