Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
editor
opens the default text editor or your favorite editor to edit an existing file,
a new file, or a tempfile, blocks while the user edits text, then returns the contents
of the file.
You can pass a parameter editor=
to specify an editor or leave it empty, in which
case the editor is:
VISUAL
, if it's set, otherwise:EDITOR
, if it's set, otherwise:'Notepad'
, if the code is running on Windows, otherwise:'vim'
If no filename is provided, a temporary file gets edited, and its contents returned.
import editor
comments = editor.editor(text='Comments here\n\n')
# Pop up the default editor with a tempfile containing "Comments here",
# then return the contents and delete the tempfile.
If a filename is provided, then that file gets edited.
import os
FILE = 'file.txt'
assert not os.path.exists(FILE)
comments = editor.editor(text=MESSAGE, filename=FILE)
# Pop up an editor for a new FILE containing MESSAGE, user edits
# This file is saved when the user exits the editor.
assert os.path.exists(FILE)
# You can edit an existing file too, and select your own editor.
comments2 = editor.editor(filename=FILE, editor='emacs -nw')
FAQs
๐ Open the default text editor ๐
We found that editor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.