Skip to main content

Edit files with your $EDITOR, like git commit does.

Project description

openeditor

Edit files with your $EDITOR, like git commit does.

Usage

Install with: pip install openeditor

# Let user edit file
s = openeditor.edit_file("path/to/my/file.txt")
print("The file now contains:\n" + s)

# Use a temp file
s = openeditor.edit_file(
    "# Please edit this file, save and close editor when done", 
    "path/to/my/file.txt"
)
print("The file now contains:\n" + s) 

The editor is obtained from, in order of precedence:

  • $VISUAL
  • $EDITOR

If none of these provide a useful editor, an exception will be thrown.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openeditor-0.2.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openeditor-0.2-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file openeditor-0.2.tar.gz.

File metadata

  • Download URL: openeditor-0.2.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.3 Linux/5.10.30-1-MANJARO

File hashes

Hashes for openeditor-0.2.tar.gz
Algorithm Hash digest
SHA256 7001048408ae7130bedae290f7acd24995d86121d0c35a7feecc3dad7ea903aa
MD5 f3b00afaeeb5e2c5eaa18c250ff427c4
BLAKE2b-256 d9044b1abc903897bf71fee952d5669a73aadb9358c5b47257ad74ed9b6a8e40

See more details on using hashes here.

File details

Details for the file openeditor-0.2-py3-none-any.whl.

File metadata

  • Download URL: openeditor-0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.3 Linux/5.10.30-1-MANJARO

File hashes

Hashes for openeditor-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 de7d22d839c72854b10d217488dd0628b457d4da3fd07fffcc96bfb1efc0237d
MD5 91f577cd57120bd6e87a1a3bdbc15856
BLAKE2b-256 2c7af16a83fe75bba0ba2c4711d906ee375a2236a4c0898782a8bd4aadf82dd8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page