By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,594 Members | 1,452 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,594 IT Pros & Developers. It's quick & easy.

Simple Python + Tk text editor

P: n/a
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?

--
Jonathan
http://qatex.sourceforge.org

Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Jonathan Fine <jf***@pytex.org> writes:
I'm looking for a simple Python + Tk text editor.

I want it as a building block/starting point.


Something wrong with IDLE?
Jul 18 '05 #2

P: n/a
Paul Rubin wrote:
Jonathan Fine <jf***@pytex.org> writes:
I'm looking for a simple Python + Tk text editor.

I want it as a building block/starting point.

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()
===

--
Jonathan
http://qatex.souceforge.org

Jul 18 '05 #3

P: n/a
On Thu, 14 Apr 2005 06:41:26 +0100, Jonathan Fine <jf***@pytex.org> wrote:
[snip]
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
--
python -c 'print "".join([chr(154 - ord(c)) for c in "U(17zX(%,5.z^5(17l8(%,5.Z*(93-965$l7+-"])'
Jul 18 '05 #4

P: n/a
Eric Brunel wrote:
<snip>
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.

--
Jonathan
http://qatex.sourceforge.net

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.