From 083b9972133fb1646b588006f0fd362b637511ea Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 21 Jan 2010 23:37:03 -0700 Subject: [PATCH] ... --- src/calibre/manual/develop.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/calibre/manual/develop.rst b/src/calibre/manual/develop.rst index e7f3103fce..b9cebcab3d 100644 --- a/src/calibre/manual/develop.rst +++ b/src/calibre/manual/develop.rst @@ -204,4 +204,18 @@ terminal. For example, you can start the GUI from the terminal as:: calibre-debug -g +Executing arbitrary scripts in the calibre python environment +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The :command:`calibre-debug` command provides a couple of handy switches to execute your own +code, with access to the calibre modules:: + + calibre-debug -c "some python code" + +is great for testing a little snippet of code on the command line. It works in the same way as the -c switch to the python interpreter:: + + calibre-debug -e myscript.py + +can be used to execute your own python script. It works in the same way as passing the script to the python interpreter, except +that the calibre environment is fully initialized, so you can use all the calibre code in your script.