Hello I'm currently working on a GUI tool in python that launches PDF files from an SQL server. Right now I write the binary to a file and then launch it using subprocess Popen, I track the file name and store the actual subprocess object in a list. When the WM_DELETE_WINDOW event is called I iterate over the child processes killing them and then use os.remove to delete the files.
Here is my code. I can launch the PDF files fine but I can't get the files to close, I receive two errors (ProcessLookupError, psutil.NoSuchProcess: psutil.NoSuchProcess process no longer exists). My file also won't delete as the process is still in use.
Here is my code. I can launch the PDF files fine but I can't get the files to close, I receive two errors (ProcessLookupError, psutil.NoSuchProcess: psutil.NoSuchProcess process no longer exists). My file also won't delete as the process is still in use.
#destroy window and clean up after self self.window.destroy() #start by killing any processes for process in self.processes: for child in psutil.Process(process.pid).children(): child.kill() process.kill() for file in self.saved_files: os.remove(file)Any help is appreciated thanks.