Python Forum
How to fork a process, kill the child and not kill the parent?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to fork a process, kill the child and not kill the parent?
#4
Hi,

You guys are probably right. fork() is probably best used with console only programs. I'll look into the thread and threading modules and will will post my results for completion of this thread.

Thanks.

Found a very simple drop in that doesn't require any setup.

import thread
import shutil
thread.start_new_thread(copy2, (src, dst))

Running this with a tkinter gui running puts the copy2() function in it's own thread. Seems to exit by itself and does not block the gui. Found examples here:

https://www.tutorialspoint.com/python/py...eading.htm

Thanks again.
Reply


Messages In This Thread
RE: How to fork a process, kill the child and not kill the parent? - by neXussT - Mar-04-2017, 09:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Ho can I get the first parent of a class? panoss 2 3,670 Jan-10-2017, 08:10 AM
Last Post: panoss

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020