Also if someone can explain what the code below is trying to do — especially the part highlighted in red — I would appreciate it.
Code:
if external_app_path.lower().endswith('calibredb.exe'):
print('running a calibredb command.')
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
fred = 'calibredb add --library-path="C:/Users/Declan/Documents/Calibre Library" -d "D:/Downloads/Merlin-Thered Been A Time - A_Fallen_Sister.epub"'
p = subprocess.Popen(fred, shell=True, startupinfo=startupinfo)
rc = p.wait()
if rc != 0:
if DEBUG: print("FAILURE for: ", fred)
else:
if DEBUG: print("...success for...", fred)