![]() |
#1 |
Member
![]() Posts: 16
Karma: 10
Join Date: Aug 2020
Device: Kobo
|
question regarding ebook-comversion command line switches
Hi,
I'm using the ebook-converter.exe as an external program in a python project and I would like to avoid the cmd output of the program but I don't find any switch to avoid these messages. Is there any switch that surpresses these messages? Jü |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,347
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No there isnt. Redirect the command output to null
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 16
Karma: 10
Join Date: Aug 2020
Device: Kobo
|
thank you for the quick answer, your hint I already tried with a strange result:
on the w11 command line the following command worked fine: ebook-convert "file 1.epub " "tmp.epub" >nul exactly the same command just copied from python program gives the following result: "Extra arguments not understood: >nul" and no conversion. Strange. |
![]() |
![]() |
![]() |
#4 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,025
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Try > nul (a space)
Also some windows programs output to stderr, so you need 2> nul instead. |
![]() |
![]() |
![]() |
#5 |
Member
![]() Posts: 16
Karma: 10
Join Date: Aug 2020
Device: Kobo
|
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??? |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 517
Karma: 2268308
Join Date: Nov 2015
Device: none
|
You need shell=True (or just use subprocess.DEVNULL for the stdout)
|
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
IMO: supplying the arguments as a python list is a lot easier than passing them as a string with all the quotes and escaping. |
|
![]() |
![]() |
![]() |
#8 |
Member
![]() Posts: 16
Karma: 10
Join Date: Aug 2020
Device: Kobo
|
@Sarmat89 and Chaley
Thank you very much, now the problem is solved ![]() For a newbee in python as me it is sometimes difficult |
![]() |
![]() |
![]() |
#9 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,025
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
search question gui vs command line | keyser666 | Calibre | 1 | 04-21-2017 11:20 AM |
Hyphenate your ebook files from the command line | acabal | Workshop | 9 | 10-05-2016 03:13 AM |
Using ebook-editor in command line | Francois_C | Editor | 12 | 04-17-2015 10:17 AM |
Command line ebook viewer? | anoved | Reading and Management | 1 | 02-13-2012 02:32 PM |
calibredb command line question (setting metadata) | mezme | Calibre | 0 | 12-06-2011 12:17 AM |