View Single Post
Old 02-28-2023, 10:46 AM   #7
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,471
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by docjc View Post
thanks for your answer, but...
this is the line
subprocess.run("ebook-convert " + "\"file 1.epub\" " + "\"tmp.epub\" " + "> nul")

This is the result:
"Extra arguments not understood: >, nul" (of course no conversion) btw where does to comma come from?
Any hint?

Where does the comma come from???
subprocess.run() is not a shell. You specify arguments, stdin, stdout, and stdout as separate parameters. See the documentation, and especially the Frequently used arguments section. From what you say I think you want stdout=DEVNULL and stderr=DEVNULL.

IMO: supplying the arguments as a python list is a lot easier than passing them as a string with all the quotes and escaping.
chaley is offline   Reply With Quote