|  11-19-2018, 10:10 PM | #1 | 
| Addict            Posts: 230 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? | 
|   |   | 
|  11-19-2018, 10:23 PM | #2 | 
| creator of calibre            Posts: 45,604 Karma: 28548974 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. | 
|   |   | 
| Advert | |
|  | 
|  11-20-2018, 07:43 PM | #3 | 
| Addict            Posts: 230 Karma: 13495 Join Date: Feb 2009 Location: SoCal Device: Kindle 3, Kindle PW,  Pocketbook 301+, Pocketbook Touch, Sony 950, 350 | 
			
			Thank you Kovid!
		 | 
|   |   | 
|  | 
| 
 | 
|  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 |