Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 11-19-2018, 10:10 PM   #1
EbokJunkie
Addict
EbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blue
 
Posts: 229
Karma: 13495
Join Date: Feb 2009
Location: SoCal
Device: Kindle 3, Kindle PW, Pocketbook 301+, Pocketbook Touch, Sony 950, 350
3.34 calibre-debug runs the script code under Python 3

Have old Python 2.7 script written in year 2013. It used to run under calibre-debug for five years. However, update to 3.34 began to throw syntax errors in all print commands in this script. Enclosing print operands in parenthesis in accordance with Python 3 standard helped.
I have 32- and 64-bit Python 2.7 and 3.4 installed on Windows 10 machine.
Bare command "Python" invokes Python 3.4.
Still, my unmodified original script runs OK under Calibre 3.31.
Is it possible that 3.34 calibre-debug in my environment somehow runs scripts under Python 3?
EbokJunkie is offline   Reply With Quote
Old 11-19-2018, 10:23 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No it doesn't run under python3, but it does require use

from __future__ import print_function


which means you need to use the function from of print() in your scripts. This is aprt of the ongoing effort to port calibre to python 3.
kovidgoyal is offline   Reply With Quote
Old 11-20-2018, 07:43 PM   #3
EbokJunkie
Addict
EbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blueEbokJunkie can differentiate black from dark navy blue
 
Posts: 229
Karma: 13495
Join Date: Feb 2009
Location: SoCal
Device: Kindle 3, Kindle PW, Pocketbook 301+, Pocketbook Touch, Sony 950, 350
Thank you Kovid!
EbokJunkie is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Python code for fetching by asin/googleid plo233 Development 6 11-16-2018 06:16 AM
Cannot run calibre-debug -g Chaaang Development 6 05-26-2017 06:10 AM
Run Calibre in Debug Mode Output to File toomuchreading Calibre 1 03-07-2016 04:58 PM
How to setup Python debug environment for Calibre Recipes huang5307 Recipes 9 03-03-2016 02:35 PM
Can calibre run a bash script when it's started? Suffolk Punch Calibre 4 04-03-2015 02:55 PM


All times are GMT -4. The time now is 04:46 AM.


MobileRead.com is a privately owned, operated and funded community.