View Single Post
Old 09-25-2015, 03:27 PM   #1186
elchamaco
Zealot
elchamaco will become famous soon enoughelchamaco will become famous soon enoughelchamaco will become famous soon enoughelchamaco will become famous soon enoughelchamaco will become famous soon enoughelchamaco will become famous soon enough
 
Posts: 128
Karma: 500
Join Date: Aug 2011
Device: kindle, boox
Hi, I've one question related to python in fact but to kindleunpack in some way.

I want to use the azw3 save file feature to strip the azw3 from a kindlegen created combi mobi. I modified the kindleunpack.py code a bit and it works really fast, now i get an azw3 file in the output dir (i want to save only the azw3 not the rest of the unpack work).

Well my problem is when i call from msdos kindleunpack.py from a directory it's unable to find the import modules, only when i'm located in the lib directory works. I'm very bad with python, is there anyway to import modules without adding them to the path in windows and calling the script from other directory?

Example

C:\kindlegen\kindleunpack\lib\kindleunpack.py

If my directory is c:\kindlegen\
And i use
python kindleunpack\lib\kindleunpack.py

the result is
ImportError: No module named compatibility_utils

If the directory is C:\kindlegen\kindleunpack\lib\ works find python finds the rest of the modules.

Thanks.

PS: I'm trying to do a batch to convert books with kindlegen but without the extrasize from the old mobi format.
In fact it would be great if a calibre plugin conversion coul be done using kindlegen, striping the azw3, modifying parameters to see it as a normal document. But i don't know if it's possible to bridge calibre azw3 conversion and i'm really bad with python, so calibre plugin is perhaps betond my capabilities so i'll try the easy way with a batch in msdos.
elchamaco is offline   Reply With Quote