Simple Python + Tk text editor

J

Jonathan Fine

Hi

I'm looking for a simple Python + Tk text editor.

I want it as a building block/starting point.

I need basic functions only:
open a file, save a file, new file etc.

It has to be open source.

Anyone know of a candidate?
 
J

Jonathan Fine

Paul said:
Something wrong with IDLE?


Thanks for this suggestion.

For some reason, I did not think of IDLE as an editor.
Must have been a blind spot.

Though not simple, IDLE is a good starting point for me.

And for my project (integration of Python and TeX) there
is most unlikely to be a better one.

However, learning IDLE details might be quite a detour
from my immediate goals.


Some code follows, in case anyone else is interested.


IDLE is not yet a package, it seems. But the idea is there.
===
jfine@apricot:/usr/lib/idle-python2.1$ cat __init__.py
# Dummy file to make this a potential package.
===

/usr/bin/idle hacked to produce an EditorWindow.
===
#! /usr/bin/python

import os
import sys
sys.path[:0] = ['/usr/lib/idle-python2.1']
import IdleConf

idle_dir = os.path.dirname(IdleConf.__file__)
IdleConf.load(idle_dir)

# new code
import Tkinter
import EditorWindow

root = Tkinter.Tk()

EditorWindow.EditorWindow(root=root)
EditorWindow.mainloop()
sys.exit()
# end of new code

# defer importing Pyshell until IdleConf is loaded
import PyShell
PyShell.main()
===
 
E

Eric Brunel

And for my project (integration of Python and TeX) there
is most unlikely to be a better one.

Do you know the (apparently dead) project named e:doc? You can find it here:
http://members.nextra.at/hfbuch/edoc/
It's a kind of word processor that can produce final documents to various formats using backends, and one of the backends is for LaTeX.

It's written in Perl, but with Perl::Tk as a tool-kit, so it is quite close to Tkinter. There may be some ideas to steal from it.

HTH
 
J

Jonathan Fine

Eric Brunel wrote:
Do you know the (apparently dead) project named e:doc? You can find it
here:
http://members.nextra.at/hfbuch/edoc/
It's a kind of word processor that can produce final documents to
various formats using backends, and one of the backends is for LaTeX.

It's written in Perl, but with Perl::Tk as a tool-kit, so it is quite
close to Tkinter. There may be some ideas to steal from it.


Thanks for this. I've not seen it before

There are quite a few GUI semi-wysiwyg front ends to (La)TeX.

Interesting that there are so many, and that besides LyX few
seem to have succeeded. Guess it's an important problem that
is also difficult.

My approach is a rather different - it is to exploit running
TeX as a daemon
http://www.pytex.org/texd

This allows for Instant Preview. My application is simply
a means of show-casing this capability. And making it
useful in simple contexts.

So what I'm really wanting to do is provide a component for
projects such as e:doc.

Any, this might be a bit off-topic.

And thanks again for the link.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top