I am trying to send .mp4 files to an mp4 tagging application. My problem is that on Windows everytime I call subprocess.call()
or subprocess.Popen()
a new process is spawned.
What I want is to open the file in the existing process if the process is already running... is this possible or will it depend on how the process being called handles new process calls?
here is what I have:
def sendToTagger(self, file):
msg = "-- " + self.getDateStamp() + "-- Sending " + os.path.basename(file) + " to Tagger...\r\n"
self.logFile.write(msg)
print(msg)
p = subprocess.Popen(['C:\\Program Files (x86)\\Tagger\\Tagger.exe', file], shell=False, stdin=None, stdout=None)
It has to spawn a new process as you are calling external command not native to your python code. But you can, if you wish wait for the process to complete by calling p.wait()