Wouldn't it be really nice if asking the user to give you some information could be easy? As easy as:
MyForm = Form() usrn_box = MyForm.add_widget(TitleText, name="Your name:") internet = MyForm.add_widget(TitleText, name="Your favourite internet page:") MyForm.edit() # usrn_box.value and internet.value now hold the user's answers.
If you think so, this library is for you.
The best way to see how it works is to download the source code and have a look at
If you want to install it, you can do:
python setup.py install
or, if you want to download and install from PyPI automatically:
You might also like to read the tutorial and documentation included with the distribution.
This framework should be powerful enough to create everything from quick, simple programs to complex, multi-screen applications. It is designed to make doing the simple tasks very quick and to take much of the pain out of writing larger applications.
The framework is easy to extend. That said, if you have a requirement for a widget that is not currently included you can try emailing me and I'll see whether I have time to help - no promises!
Recent versions of the library have support for the mouse. The default support is limited, but easily extended.
The library aims to support unicode/utf-8. Please report any problems using the bug-tracker at code.google.com/p/npyscreen.
I am working on a new mechanism for creating Forms which will make resizing forms automatic when the terminal resizes. However, in the meantime, the library will create forms based on a fixed size (determined when the Form is created). On the plus side, this library does make sure that a resized terminal will not cause your application to crash. (In fact, this library was first inspired by the desire to be able to write applications that would not crash merely because a terminal window had changed shape. Things rapidly got more complicated.)
You might also like urwid.
Compared to npyscreen, urwid is more like a traditional, event-driven gui library, and targets other display devices as well as curses. ::...
订阅 substack 体验古早写作: