This is the page of tmPython, the TeXmacs Python plugin.
Provides:
A 'Mathematica Notebook' styled interface to Python from within TeXmacs. Blocks of code can be run independently of their order, and full multiline blocks, i.e. function remain visible and easily modifiable.
I'm currently using the plugin on daily basis and haven't notice any problem/error. Anyone discovering a bug or interested in a certain feature is more than welcome to contact me. E-mail: ero (at) this_domain
Features:
- Postscript output to TeXmacs (see screenshot)
- Full access to all Python features and modules
- Multiline input (check Bugs)
- Autocompletion of:
- Language keywords.
- Builtin methods
- Imported modules and their methods and attributes(recursively)
- Classes and their methods and attributes(recursively)
- Literal strings. e.g. 'text'.rfi is completed to 'text'.rfind
- Graceful exception handling (as far as it has been tested) with backtrace printing.
Bugs:
I could not get TeXmacs Multiline input support (on which the plugins notify TeXmacs when they are done receiving a command) working, therefore I avoided using it.
This plugin can, however, work on Multiline 'mode'. But, without the aforementioned feature the plugin has to guess where the newlines are, as TeXmacs converts the Multiline blocks into one line, by substituting the newlines with whitespaces.
tmPython solves this problem by converting every sequence of two up to N whitespaces into a sequence of a newline followed N-1 whitespaces.
So, it's better to be aware that Two or more spaces in any Python statement/expression entered will cause the first whitespace to be substituted by a newline.
Due the the mentioned limitations, it's also not possible to enter multiline non-indented block of statements/expressions, as there won't be the required 2 spaces used to guess a line break. This can be solved by terminating the statements with semi-colon (This should not be a big issue, as most of the times, multiline blocks are used indented, e.g. when defining function, loops, etc), or by entering the code in different lines.
Download:
You can get the latest version (0.8.1) from this site.
It is also available in TeXmacs starting from version 1.0.3.5.
Installation:
Unpack the downloaded archive into your TeXmacs plugins folder, usually $HOME/.TeXmacs/plugins/ and it should be loaded automatically. It can be launched from where the Sessions are listed, clicking on Python.
Screenshots:
A typical tmPython session within TeXmacs.
(The version 0.3.1 of PyX was used in the session's screenshot. Chu-Ching Huang noted that newer versions may require to change graph.paramfunction into graph.data.paramfunction.)
Postscript output from tmPython within TeXmacs.
Graphviz's Python interface and Postscript output from tmPython within TeXmacs.