Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77418

Re: Editing text with an external editor in Python

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>
Date 2014-09-02 08:30 +1000
Subject Re: Editing text with an external editor in Python
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.13698.1409610612.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Sep 2, 2014 at 4:23 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> Chris Angelico wrote:
>> C:\>Python34\python 123123123.py
>> cygwin warning:
>>   MS-DOS style path detected: C:\DOCUME~1\M\LOCALS~1\Temp\tmp94rcwd57
>>   Preferred POSIX equivalent is: /DOCUME~1/M/LOCALS~1/Temp/tmp94rcwd57
>
> That's arguably a Python bug. Under Cygwin, it should use POSIX paths rather
> than Windows paths.

Except that I wasn't; I ran Python 3.4 that was installed via the .msi
package, and from that Python ran nano that was presumably compiled
for Cygwin.

>> Windows doesn't have a nice $EDITOR environment variable to call on,
>
> Why not? It's your environment, you can create any environment variable you
> like, even under Windows, right?

Sure, but what I mean is, there's a general convention on Unix that
setting EDITOR will do that. You don't get to take advantage of
expectations that easily on Windows.

> But fundamentally, the de facto "standard editor" on Windows is Notepad.

Sadly so. Which is why I tried it...

>> You'll also have to cope with some other possibilities. What happens
>> if someone tries Notepad? (Don't try this at home. We are experts and
>> are testing on a closed track. Do not use Notepad unless you, too,
>> have thirty years of special effects experience.) Turns out it doesn't
>> like working with a file that another process has open.
>
> Ah, I feared that would be the case. I'll have to think about a way around
> that. It won't be as neat, or as secure, but it should be doable.

... and yeah. That's the problem.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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