Pyditor, Text editor fully extendible in python a la' Emacs

Jason Cunliffe jasonic at nomadicsltd.com
Sat Jan 27 20:30:27 EST 2001


Nahuel Greco <ngreco at softhome.net> wrote in message
news:mailman.980635233.16241.python-list at python.org...
> I have a dream, of a perfect text editor (im calling it pyditor, but name
it
> as you want ):

'Perfect test editor' could start a religous war a this is like saying
'perfect huamn being'. Every persons neds are different and continue to
change.

For Python-oriented people, does'nt the need for useful Python tools pretty
much mean that sooner or later 'text-editor' becomes 'IDE'?

[...snip impressive feature wishlist...]

>  I cant think a way that this will not be a python killer-app, and extend
>  the use of python to all the programmers / guys that use too much a text
>  editor community.

I agree that Pythonic text editor is a terrific idea, and would be of great
strategic value. A very ambitious project.

A small parallel, is perhaps what is happening now with Blender
http://www.blender.nl, a free cross-platform 3D modelling and animation
software with Python API. The Python API is really opening up the use of
Blender and also motivating new people to Python programming
http://www.janw.gothere.uk.com/documentation.html
http://www.users.globalnet.co.uk/~acox/index.html
http://jmsoler.free.fr/didactitiel/blender/tutor/english/python_script00.htm
with Lovely Potatoids!!
http://jmsoler.free.fr/didactitiel/blender/tutor/english/python_script05.htm
http://jmsoler.free.fr/didactitiel/blender/tutor/python_wireshadows.htm
http://jmsoler.free.fr/didactitiel/blender/tutor/english/index_prog_python.h
tm

Interstingly Blender is free, cross-platform but not openSource.
Does not appear for thime being to hinder al sorts of intersting Python
developments with it.

[...snip..]

>  But, i dont have the time and the editor code knowledge to code this
piece of
>  software, im only posting the ideas. I think that before write this, will
be
>  good to analize the code / API of Emacs / Xemacs / Texmacs / Lyx, and
other
>  editors to code the perfect one :)

Two projects you should pehaps look into more deeply:

wxPython
http://wxpython.org/
There are some editor examples in the wxPython Demo, included when you
download it.
Check out #\python\wxPython\demo\wxPyEditor.py
-----------------------------
#wxPyEditor.py
from wxPython.wx         import *
from wxPython.lib.editor import wxEditor, wxPyEditor

def runTest(frame, nb, log):
    win = wxPanel(nb, -1)
    ed = wxEditor(win, -1, style=wxSUNKEN_BORDER)
    pyed = wxPyEditor(win, -1, style=wxSUNKEN_BORDER)
    box = wxBoxSizer(wxVERTICAL)
    box.Add(ed, 1, wxALL|wxGROW, 5)
    box.Add(pyed, 1, wxALL|wxGROW, 5)
    win.SetSizer(box)
    win.SetAutoLayout(true)

    ed.SetText(["",
                "This is a simple text editor, the class name is",
                "wxEditor.  Type a few lines and try it out.",
                ""])

    pyed.SetText(["# This one is a derived class named wxPyEditor.",
                  "# It adds syntax highlighting, folding (press",
                  "# F12 on the \"def\" line below) and other stuff.",
                  "import sys",
                  "def hello():",
                  "    print 'hello'",
                  "    for x in sys.path:",
                  "        print x",
                  ""])
    return win
-----------------------------
Boa Constructor
http://boa-constructor.sourceforge.net/
:See how/what could be separated from that to meet your needs.
:Boa already has some nice beginnings of Python editor

Scintilla:
http://www.scintilla.org/
<quote>
Development of Scintilla started as an effort to improve the text editor in
PythonWin. After being frustrated by problems in the Richedit control used
by PythonWin, it looked like the best way forward was to write a new edit
control. The biggest problem with Richedit and other similar controls is
that they treat styling changes as important persistent changes to the
document so they are saved into the undo stack and set the document's dirty
flag. For source code, styling should not be persisted as it can be
mechanically recreated.

Scintilla and SciTE are currently available for Intel Win32 and Linux
compatible operating systems with GTK+. They have been run on Windows 95, NT
4.0, Windows 2000, and on Red Hat Linux 4.2, 6.1 and Solaris with GTK+
1.2.0.
</quote>
used in Boa also I think


- Jason
___________________________________________________________
Jason CUNLIFFE = NOMADICS['Interactive Art and Technology']





More information about the Python-list mailing list