🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

get-multiline-input-with-editor

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-multiline-input-with-editor

Opens a text editor for multi-line input, returns input as a Unicode string. Just like what Git does.

pipPyPI
Version
0.1.0a3
Maintainers
1

get-multiline-input-with-editor

Opens a text editor for multi-line input, returns input as a Unicode string. Just like what Git does.

Installation

pip install get-multiline-input-with-editor

Usage

from get_multiline_input_with_editor import get_multiline_input_with_editor

result = get_multiline_input_with_editor(
    unicode_initial_input=u"Write something...",
    unicode_prompt_at_bottom=u"# Enter your text above. Lines starting with # will be ignored.",
    unicode_line_comments_start_with=u"#",
    editor=None  # or specify e.g. 'vim'
)

print(result)

Assuming nano is the default editor, the user will see something like this:

GNU nano 7.2    /tmp/tmp9khfi5es.txt                                                                                                 
Write something...
# Enter your text above. Lines starting with # will be ignored.













^G Help         ^O Write Out    ^W Where Is     ^K Cut          ^T Execute      ^C Location     M-U Undo        M-A Set Mark
^X Exit         ^R Read File    ^\ Replace      ^U Paste        ^J Justify      ^_ Go To Line   M-E Redo        M-6 Copy

Afterward, if the user enters some text, print(result) basically prints whatever the user entered, minus the comments.

Contributing

Contributions welcome! Please open issues or pull requests on GitHub.

License

This project is licensed under the MIT License.

FAQs

Did you know?

Socket

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.

Install

Related posts