Discussion:
[pyclewn] Installing Pyclewn with an embedded Python
Brooks, Phil
2013-06-08 00:13:27 UTC
Permalink
Hi,

I am trying to figure out how to install Pyclewn so that it will work with an embedded Python interpreter in an application. The specific tool I am trying to install it with is Sage - the open source math analysis tool (www.sagemath.org). It builds its own Python interpreter and the application itself consists of a large number of math extensions to Python. I would like to be able to run Pyclewn on the Sage Python interpreter as it runs its Python scripts.

Any suggestions for how to do this? I don't want to mess up my existing Pyclewn/Python/Gvim installations on my machine.

Phil
Xavier de Gaye
2013-06-08 08:00:44 UTC
Permalink
Post by Brooks, Phil
Hi,
I am trying to figure out how to install Pyclewn so that it will
work with an embedded Python interpreter in an application. The
specific tool I am trying to install it with is Sage - the open
source math analysis tool (www.sagemath.org). It builds its own
Python interpreter and the application itself consists of a large
number of math extensions to Python. I would like to be able to run
Pyclewn on the Sage Python interpreter as it runs its Python
scripts.
Hi Phil,

The following page describes how to debug a sage script with pdb:

http://www.sagemath.org/doc/reference/cmd/sage/misc/trace.html

According to this, you run your script through pexpect after having
inserted "import pdb; pdb.set_trace()". If this works, then you should
be able to use pyclewn by inserting instead
import clewn.vim as vim; vim.pdb()
and attaching to the pexpect process with ":Pyclewn pdb" as described
in pyclewn documentation.

Note: if the pyclewn installation is local, insert

import sys, os; sys.path.append(os.path.join(os.environ['HOME'],
'lib/python'))
import clewn.vim as vim; vim.pdb()
--
Xavier

Les Chemins de Lokoti: http://lokoti.alwaysdata.net
Loading...