Simple Python + Tk text editor

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jonathan Fine

    #1

    Simple Python + Tk text editor

    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


  • Paul Rubin

    #2
    Re: Simple Python + Tk text editor

    Jonathan Fine <jfine@pytex.or g> writes:[color=blue]
    > I'm looking for a simple Python + Tk text editor.
    >
    > I want it as a building block/starting point.[/color]

    Something wrong with IDLE?

    Comment

    • Jonathan Fine

      #3
      Re: Simple Python + Tk text editor

      Paul Rubin wrote:[color=blue]
      > Jonathan Fine <jfine@pytex.or g> writes:
      >[color=green]
      >>I'm looking for a simple Python + Tk text editor.
      >>
      >>I want it as a building block/starting point.[/color]
      >
      >
      > Something wrong with IDLE?[/color]


      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.__fil e__)
      IdleConf.load(i dle_dir)

      # new code
      import Tkinter
      import EditorWindow

      root = Tkinter.Tk()

      EditorWindow.Ed itorWindow(root =root)
      EditorWindow.ma inloop()
      sys.exit()
      # end of new code

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

      --
      Jonathan


      Comment

      • Eric Brunel

        #4
        Re: Simple Python + Tk text editor

        On Thu, 14 Apr 2005 06:41:26 +0100, Jonathan Fine <jfine@pytex.or g> wrote:
        [snip][color=blue]
        > And for my project (integration of Python and TeX) there
        > is most unlikely to be a better one.[/color]

        Do you know the (apparently dead) project named e:doc? You can find it here:

        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+-"])'

        Comment

        • Jonathan Fine

          #5
          Re: Simple Python + Tk text editor

          Eric Brunel wrote:
          <snip>
          [color=blue]
          > 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.[/color]


          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


          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




          Comment

          Working...