一个简单的、跨平台的、纯python模块,用于类似javascript的消息框。
PyMsgBox的Python项目详细描述
Pymsgbox
一个简单的、跨平台的、纯python模块,用于类似javascript的消息框。
要导入,请运行:
>>> from pymsgbox import *`
pymsgbox中有四个函数,它们遵循javascript的消息框命名约定:
>>> alert(text='', title='', button='OK')`
Displays a simple message box with text and a single OK button. Returns the text of the button clicked on.
>>> confirm(text='', title='', buttons=['OK', 'Cancel'])`
Displays a message box with OK and Cancel buttons. Number and text of buttons can be customized. Returns the text of the button clicked on.
>>> prompt(text='', title='' , defaultValue='')`
Displays a message box with text input, and OK & Cancel buttons. Returns the text entered, or None if Cancel was clicked.
>>> password(text='', title='', defaultValue='', mask='*')`
Displays a message box with text input, and OK & Cancel buttons. Typed characters appear as *. Returns the text entered, or None if Cancel was clicked.
在LinuxPython2上,首先需要通过运行:sudo apt get install python tk来安装Tkinter
修改的BSD许可证
源自斯蒂芬·雷蒙德·弗格的随和http://easygui.sourceforge.net/