View Single Post
Old 04-06-2020, 08:52 AM   #5
halloleo
Groupie
halloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
Posts: 156
Karma: 12649
Join Date: Feb 2020
Device: iPad
Thanks for all the responses!

I just downloaded 4.13 from the website. So ok, it's Python 2. Fair enough. But I get a strange error which feels like a Python 3 error:

Say, I write the following script:

Code:
import calibre
print calibre.__version__
Then I call

Code:
calibre-debug script.py
and get an error:

Code:
Python function terminated unexpectedly: invalid syntax (script.py, line 2)
Traceback (most recent call last):
  File "/Applications/Optional/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 187, in main
    return run_entry_point()
  File "/Applications/Optional/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 121, in run_entry_point
    return getattr(pmod, func)()
  File "site-packages/calibre/debug.py", line 348, in main
  File "site-packages/calibre/debug.py", line 260, in run_script
  File "/Users/toki/devel/calibre/play/script.py", line 3
    print calibre.__version__
                ^
SyntaxError: invalid syntax
But a Python3 script like

Code:
import calibre
print(calibre.__version__)
works fine. Why's that?
halloleo is offline   Reply With Quote