Ok here is the code I have now. I use multiprocessing to launch the pdf, however it's still not closing my file.
def LaunchPDF(filename): """ Launches PDF by filename and tracks PID @param filename, the name of the file to launch @return None """ print(filename) os.startfile(filename) def QueryShubertFiles(self): """ Queries the blob data from table based on filename. @param, self the App object. @return None. """ for element in self.SectionList.curselection(): value = self.Query("SELECT Data FROM ShubertDocs WHERE Filename = '" + self.SectionList.get(element) + "';") if ".JPG" in self.SectionList.get(element): bio = BytesIO(value[0][0]) Image.open(bio).show() elif ".PDF" in self.SectionList.get(element) or ".pdf" in self.SectionList.get(element): #track files saved to disk self.saved_files.append(self.SectionList.get(element)) try: with open(self.SectionList.get(element), 'wb') as f: f.write(value[0][0]) except: pass #doc = Popen("start /WAIT " + self.SectionList.get(element), shell=True) self.processes.append(multiprocessing.Process(target=LaunchPDF, args=(self.SectionList.get(element),))) self.processes[-1].start() def on_closing(self): self.window.destroy() ## wait 2 seconds and kill all processes time.sleep(2) print(self.processes) for process in self.processes: process.terminate() process.join() print(process, "terminated") #clean up for file in self.saved_files: os.remove(file)When I print the processes it tells me they are all stopped, then when I attempt to remove the files I receive a process is still being used. The pdf never closes.