mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] input() in python plugin


Chronological Thread 
  • From: "David E. Miller" <address@hidden>
  • To: Julien Frontisi <address@hidden>
  • Cc: address@hidden
  • Subject: Re: [TeXmacs] input() in python plugin
  • Date: Mon, 08 Apr 2013 11:39:17 -0400
  • Authentication-results: smtp03.embarq.synacor.com smtp.user=address@hidden; auth=pass (LOGIN)
  • X_cmae_category: 0,0 Undefined,Undefined

Hi Julien:

I agree that the combination of TeXmacs with session plugins should be an attractive feature that people can use to advantage. In my opinion the Maxima and its TeXmacs plugin. is a top-notch combination. Likewise for the TeXmacs-Python combination.

But, (there is always a but) there are some issues in general. I would like to use the Octave plugin. Unfortunately it is broken. The Shell plugin is dead on my versions of TeXmacs - both MS Windows and OS X. The Maxima plugin and the Python plugin both appear to work well and to be stable. The Maxima plugin appears to have active and ongoing support. The Python plugin, not as much. Since I would not expect extreme changes in the way Python behaves, I speculate that this plugin will remain stable through TeXmacs version changes, which would be my primary concern related to your comments below. There is also the issue of Python 2 vs Python 3. The TeXmacs plugin is Python 2 as far as I can tell. It may also work with Python 3, but I have not tried this. It seems to me that I remember receiving an email from the dev or user mail list recently about Python 3 with TeXmacs. I will look for it.

For your information related to your comments below, I have thrown quite a bit of test cases at the TeXmacs Python plugin and in all cases this has been successful. This includes NumPy, SciPy, Matplotlib, Scitools, etc. It also includes the Oct2Py module that is a Python interface to Octave.

However, having said that, I am skeptical that the existing TeXmacs Python plugin is optimal for serving as a full-featured development or learning interface for Python. It would require it seems a major programming effort to duplicate say the iPython shell for example using a TeXmacs plugin. What TeXmacs does well is produce math- and science-oriented technical documents. It can include input and output from sessions via plugins from other programs like Maxima, Python. et al. However, it would seem to me that this presents some limitations depending on the subject involved. Presenting results is one thing, using a TeXmacs session as an IDE is quite another. The issue you encountered is an example of one kind of issue that may be encountered. I am not sure that you will be happy with the effort to use TeXmacs as a "complete Python environment." You might look at the iPython Notebook based on what is seems you are aiming for.

Best wishes:

David Miller


On 4/7/2013 4:45 AM, Julien Frontisi wrote:
Thanks again to David.
The reason I'm asking about this python plugin is because python is about to be taught,
starting this coming September, in every scientific "classe préparatoire" in
France, as part of the new computer science curriculum. I believe it would be a great
opportunity to expand the visibility of TeXmacs here if it could be used as an complete
environment for python.
Julien

Le 13 mars 2013 à 08:26, Julien Frontisi a écrit :

Hi, David,
yes, calling input() from the TeXmacs Python session prompt is exactly what I
was trying to do and that is also what happened.
Thanks for your explanation.
Julien

Le 13 mars 2013 à 04:30, David E. Miller a écrit :

Julien:

I find now that the latest versions of TeXmacs I now have include the Python
plugin of Ero Carrera (2004) as modified by Adrián Soto (2012).

I am not sure what you mean exactly about the input() and raw_input() methods "not answering" as
you say. I presume you mean that when you insert a Python session that you get the yellow "Busy
..." box and no "Python]" prompt.

Are you calling input() or raw_input() from a TeXmacs Python session prompt? If so then you will
get "Busy..." for sure. These are waiting for your input which never comes through the
plugin it would seem. If so I speculate that this is a limitation of the plugin since the plugin
code uses raw_input() to capture the input from TeXmacs. If you are inputting raw_input() from
the TeXmacs "Python]" prompt, then this is like inputting raw_input() as a response to
raw_input() so now you have a raw_input hanging with no way to get an input to the first
raw_input() used by the plugin code in tm_python.

David Miller



On 3/12/2013 12:19 PM, Julien Frontisi wrote:
Hi again,
I've been trying to use python plugin in TeXmacs but the input() and
raw_input() function do not answer. I just get the Busy... signal until I
press the Stop button. Does it work with someone else ?
Thanks
Julien



Le 19 déc. 2012 à 08:41, Julien Frontisi <address@hidden> a écrit :

Hi everyone,
I'm playing with Adrian's python plugin and it's very nice but the input()
function just stalls.
Any idea ? Thanks.
Julien





Archive powered by MHonArc 2.6.19.

Top of page