4 ms·
The %%tex directive to convert Python to LaTex looks useful. Does anyone know whether there is a similar way to output the Python code in C++ syntax?
by RossBencina 6y ago
The %%tex directive to convert Python to LaTex looks useful. Does anyone know whether there is a similar way to output the Python code in C++ syntax?
- crashocaster 6y agoThis can be done by 'unparsing' the python AST. We do this in the DaCe project: https://github.com/spcl/dace/blob/900cac070c4b083653c672e2250c07fd32d1e0dd/dace/codegen/cppunparse.py#L156 https://github.com/spcl/dace/blob/900cac070c4b083653c672e225...