Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #77455
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'root': 0.05; 'subject:text': 0.05; 'subject:Python': 0.06; 'tkinter': 0.07; 'cursor': 0.09; 'deploy': 0.09; 'editor.': 0.09; 'expected.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:editor': 0.09; 'windows,': 0.09; 'python': 0.11; 'gui': 0.12; 'jan': 0.12; 'wrote': 0.14; 'added.': 0.16; 'backspace': 0.16; 'entry.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'selects': 0.16; 'tab': 0.16; 'wrote:': 0.18; 'widget': 0.19; 'select': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'script.': 0.24; "shouldn't": 0.24; 'text.': 0.24; 'least': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'function': 0.29; 'chris': 0.29; 'am,': 0.29; 'quickly': 0.29; 'adequate': 0.31; 'keys': 0.31; 'sep': 0.31; 'this.': 0.32; 'option': 0.32; 'text': 0.33; 'beginning': 0.33; 'minimal': 0.33; 'not.': 0.33; 'subject:with': 0.35; 'info': 0.35; 'test': 0.35; 'entry': 0.36; 'too': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'functional': 0.39; 'received:71': 0.39; 'delete': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'even': 0.60; 'easy': 0.60; 'most': 0.60; 'save': 0.62; 'movement': 0.65; 'between': 0.67; 'home': 0.69; 'cut': 0.74; 'delete,': 0.84; 'received:fios.verizon.net': 0.84; 'absolutely': 0.87 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Terry Reedy <tjreedy@udel.edu> |
| Subject | Re: Editing text with an external editor in Python |
| Date | Tue, 02 Sep 2014 17:14:28 -0400 |
| References | <54049ab7$0$29972$c3e8da3$5496439d@news.astraweb.com> <mailman.13692.1409589319.18130.python-list@python.org> <5404b987$0$30001$c3e8da3$5496439d@news.astraweb.com> <mailman.13694.1409602073.18130.python-list@python.org> <zjfNv.198388$rQ.139558@fx13.am4> <CAPTjJmpPjBmtgC2dvuYmGQNc900rb=XUt5LRGHwS0--G+_xCew@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Gmane-NNTP-Posting-Host | pool-71-175-90-87.phlapa.fios.verizon.net |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
| In-Reply-To | <CAPTjJmpPjBmtgC2dvuYmGQNc900rb=XUt5LRGHwS0--G+_xCew@mail.gmail.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.13719.1409692486.18130.python-list@python.org> (permalink) |
| Lines | 47 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1409692486 news.xs4all.nl 2958 [2001:888:2000:d::a6]:59762 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:77455 |
Show key headers only | View raw
On 9/2/2014 4:45 AM, Chris Angelico wrote: > On Tue, Sep 2, 2014 at 6:35 PM, alister > <alister.nospam.ware@ntlworld.com> wrote: >> if edlin is your only option then it would be better to spend you time >> writhing your own text editor! > > Heh! > > Considering how easy it is to deploy a multi-line edit widget in any > GUI toolkit, it shouldn't be too hard to write a GUI text editor. Most Python installations have tkinter available. I quickly wrote an absolutely minimal script. import tkinter as tk root = tk.Tk() text = tk.Text() text.pack() root.mainloop() I tested tested the functions and wrote the following. This is a test text entry. Enter and Tab work as expected. The Arrow (Cursor) keys work as expected. CntL-Left and Cntl-Right move a word at time. Home and End move to beginning and end of the line. Cntl-Home and Cntl-Up move to the beginning of the text. Cntl-End and Cntl-Donw move to the end of the text. Shift + cursor movement selects between the begin and end slice positions. PageUp and PageDown are inoperative. Delete and Backspace work as expected. At least on Windows, I can select text and delete, or cut or copy to Clipboard. I can also paste from the clipboard. In otherwords, this is a functional minimal text entry widget. I did not even know about Shift-movement selecting until I tried it. Notepad has this. Thunderbird's text entry does not. I think the above is adequate for most multi-line text entry. In use, a save function would have to be added. A help text with the above info would be good too (Idle needs this). -- Terry Jan Reedy
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Editing text with an external editor in Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-02 02:11 +1000
Re: Editing text with an external editor in Python Chris Angelico <rosuav@gmail.com> - 2014-09-02 02:35 +1000
Re: Editing text with an external editor in Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-02 04:23 +1000
Re: Editing text with an external editor in Python Tim Chase <python.list@tim.thechases.com> - 2014-09-01 15:06 -0500
Re: Editing text with an external editor in Python alister <alister.nospam.ware@ntlworld.com> - 2014-09-02 08:35 +0000
Re: Editing text with an external editor in Python Chris Angelico <rosuav@gmail.com> - 2014-09-02 18:45 +1000
Re: Editing text with an external editor in Python alister <alister.nospam.ware@ntlworld.com> - 2014-09-03 08:06 +0000
Re: Editing text with an external editor in Python Terry Reedy <tjreedy@udel.edu> - 2014-09-02 17:14 -0400
Re: Editing text with an external editor in Python Chris Angelico <rosuav@gmail.com> - 2014-09-03 07:36 +1000
Re: Editing text with an external editor in Python Terry Reedy <tjreedy@udel.edu> - 2014-09-02 21:49 -0400
Re: Editing text with an external editor in Python Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-09-02 22:03 -0500
Re: Editing text with an external editor in Python Chris Angelico <rosuav@gmail.com> - 2014-09-02 08:30 +1000
Re: Editing text with an external editor in Python Roy Smith <roy@panix.com> - 2014-09-01 13:06 -0400
Re: Editing text with an external editor in Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-02 04:02 +1000
Re: Editing text with an external editor in Python Cameron Simpson <cs@zip.com.au> - 2014-09-02 08:14 +1000
Re: Editing text with an external editor in Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-02 13:18 +1000
Re: Editing text with an external editor in Python Chris Angelico <rosuav@gmail.com> - 2014-09-02 08:25 +1000
Re: Editing text with an external editor in Python gschemenauer3@gmail.com - 2014-09-01 19:24 -0700
csiph-web