J
johnny
I have a module called ftp and I have another module called
processKick. What I need is to have processKick, create fork and
execute ftp like below.
Relevant processKick code as follows:
def do_child_stuff():
ftp
def fork_test():
pid = os.fork()
if pid == 0:
# child
do_child_stuff()
os._exit(0)
# parent - wait for child to finish
os.waitpid(pid, os.P_WAIT)
Can someone also tell me what is the purpose of
if __name__ == "__main__":
Do I have to call, main of ftp module within processKick?
Thank you in advance
processKick. What I need is to have processKick, create fork and
execute ftp like below.
Relevant processKick code as follows:
def do_child_stuff():
ftp
def fork_test():
pid = os.fork()
if pid == 0:
# child
do_child_stuff()
os._exit(0)
# parent - wait for child to finish
os.waitpid(pid, os.P_WAIT)
Can someone also tell me what is the purpose of
if __name__ == "__main__":
Do I have to call, main of ftp module within processKick?
Thank you in advance