console application gui for python

六眼飞鱼酱① 提交于 2019-11-29 08:30:14

If you're using Windows you will ultimately need to integrate with the win32 console API to create a console GUI (aka. a Text UI or TUI). Your options are basically:

  1. Write your TUI using curses or the packages that sit on top of it, like urwid or npyscreen. To do this you either need to install cygwin or PDcurses to make it work.
  2. Write to the win32 API directly using something like pywin32.
  3. Use a package that simplifies the win32 API like effbot's console package.

I found all the above unsatisfactory as I didn't want all the hassle of installing 3rd party binaries for Windows and wanted an API that I could use anywhere (after a simple pip install), so I wrote a cross-platform package (asciimatics) to fix it. This package takes all the hassle away and provides a clean, documented API with a set of widgets for TUI applications.

For example the following is a screenshot of the contacts list sample code referenced in the previous docs link, showing some of the basic text and button widgets.

Take a look at Python's curses library:

If you'd like a Python shell, then you might want to look at something like PyFlakes / PyShell or similar.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!