I want to write a python automation program for merge html files in a epub using ebook-edit(in MacOS sub directory) in calibre. I know how to do it manually but I want to it many epub files automatically in python. What should I do after the opening the epub file with ebook-edit?
import os, shlex, keyboard, time
from subprocess import Popen, PIPE
filename = 'test.epub'
command_line = '/Applications/calibre.app/Contents/MacOS/ebook-edit '+ '"'+ filename+ '"'
args = shlex.split(command_line)
p = Popen(args, stdin=PIPE)