How can i call Python/Shell from a macro ?
"Dr. Nicola Mingotti" <[email protected]>
| Newsgroups | gmane.editors.texmacs.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, I am able to write simple macros in the preamble. I wish to define a macro that takes in a TeXmacs text and does some computations with Python (or other, actually my favorite is Ruby) then prints out the result of Python execution. I have tried to copy from what: Insert -> Fold -> Executable -> Python does, but unsuccessfully. <script-input|python|default|123+1> => nope, does not run as I expect. My aim is this, i have a lot of very easy calculation steps in an engineering document, i wish to be able to write the expression to compute e.g. $123.4_[m] / 1.2_[m]$ then call the macro above it and have it become $123.4_[m] / 1.2_[m]$ = <RESULT_OF_PYTHON_EATING_THE_FORMULA>. It could be fine for me to call the shell. At the moment I think every call to the Shell/Python/xxx can be independent, that is, i don't need/want to memorize previous calculations outcome to do the next. bye Nicola