pythontex icon indicating copy to clipboard operation
pythontex copied to clipboard

Namespace sharing between pysub and pyconsole

Open reckoner opened this issue 5 years ago • 2 comments

\begin{pyconsole}
import math
\end{pyconsole}

\begin{pysub}
$1 + 1 = !{math.sqrt(1+1)}$
\end{pysub}

The pysub block does not recognize the math import from the pyconsole block. Is there a way to fix this?

reckoner avatar Sep 05 '20 17:09 reckoner

Everything in the pycon* commands and environments is in a separate session from all the other py* command and environments. So nothing is shared between them. I suppose it would be possible to create a pyconsub...unfortunately, I have almost no time for writing software at present.

gpoore avatar Sep 05 '20 19:09 gpoore

I would be willing to look into it, if you don't think it's too difficult.

reckoner avatar Sep 08 '20 20:09 reckoner