npyscreen.py

Rapid UI development for python/curses

(Putting a user interface on your hacks^W programs without all that mucking around in hyperspace)


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.


This is a curses library and application framework for python that provides a reasonably comprehensive set of default widgets.

The best way to see how it works is to download the source code and have a look at EXAMPLE.py.

You can download the latest version of the software from Google Code or from PyPI.

If you want to install it, you can do:

python setup.py install

or, if you want to download and install from PyPI automatically:

easy_install npyscreen

You might also like to read the tutorial and documentation included with the distribution.

Strengths

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!

Limitations

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.)

Similar Projects

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. ::...


免责声明:
当前网页内容, 由 大妈 ZoomQuiet 使用工具: ScrapBook :: Firefox Extension 从互联网中抓取并分享;
内容版权归原作者所有;
本人对内容的有效性/合法性不承担任何强制性责任.
若有不妥, 欢迎评注提醒:

蟒营®编程思维提高班 Python版/第11期 正在报名

精品小班/ 每期<42人

扫描报名: 101camp11py

蟒营®式 原创课程

伴你重享学习乐趣

官网: py.101.camp

Reactivate Joy by Self-teching with You


任何问题可先进入知识星球(免费)咨询:
FAQ

关注公众号, 持续获得相关各种咨询:
mainium


追问

任何问题, 随时邮件提问可也:
askdama@googlegroups.com


...::