python simple graphical interface GUI entry --easygui [turn]

Original: https: //blog.csdn.net/mingqi1996/article/details/81272621

Gui do feel a sense of accomplishment it is relatively high, completion of basic language way to spend an afternoon and see GUI design, now in retrospect that if you do a formal presentation is too simple, easygui just a small demonstration purposes.
 
 
Download

first easygui package download, in two ways:

1) at ambient python with pip3 install direct mounting

2) VS2015 + Python environment is now disposed directly downloaded in VS:

 

 
Wait for the installation to complete, simply call the messagebox test:

 


Import was successful.

 
Function Introduction

 

1) msgbox () - Message pop

msgbox (msg = '', title = '', ok_button = '', image = None, root = None)

This function is generally called before the keyword to three, loading pictures of words to image the assignment need to download additional libraries, or can only load GIF.

 

 
2) ccbox () - bis item selection

ccbox (msg = '', title = '', choices = ( '', ''), image = None)

one more option choices (receiving only two options! )

returns a Boolean value Ture or False.

 


3)buttombox()——多项选择

buttonbox(msg=' ', title=' ', choices=('Button1', 'Button2', 'Button3'), image=None, root=None)

该函数和ccbox()不一样,其返回值为button的对应文本字符,


4)choicebox()、multchoicebox()——可选的下拉列表

choicebox(msg=' ', title=' ', choices=())  

选项输入不再是单个元素,此处是以整个序列的方式输入,如列表、元组等;

选择选项后确认,会返回选项内容的文本内容,否则是none

multchoicebox()功能同样,只是他可以提供多选,多选的返回值是多选的文本列表

 


5)enterbox()——文本输入框

enterbox(msg='  ', title=' ', default=' ', strip=True, image=None, root=None)

其中,default关键字定义的是文本框默认值,strip的值为True时会自动忽略输入的首尾空格,False则相反;

返回值为输入的字符串;


interbox()

integerbox(msg='', title=' ', default='', lowerbound=0, upperbound=99, image=None, root=None, **invalidKeywordArguments)

该文本框只能输入界定范围内的整型数,返回值为输入值。

 

6)mulenterbox()

multenterbox(msg=' ', title=' ', fields=(), values=())

其中values是输入的默认值、feilds是需要填写的条目名称,均用列表填写;

返回值是所有填写的值构成的列表;


7)passwordbox()——密码输入框(不显示)

passwordbox(msg=' ', title=' ', default=' ', image=None, root=None)

基本关键字上面都介绍过了:提示语、标题、默认值等;

与文本框也类似,只是显示时会是*,更接近密码输入;

返回值依然是输入文本;


multpasswordbox()

更加实用的类型,与上面类似,不过其只有最后一个框是匿名的,即密码输入;

其他都一样,返回值为列表形式;


以上仅是实用easygui简单显示界面,了解之后发现其功能过于简单.....后面如果需要可视化展示还是用其他的方法,在此Mark一下:

Tkinter、wxPython、Jython

部分信息科参见:

http://www.runoob.com/python/python-gui-tkinter.html

Guess you like

Origin www.cnblogs.com/mazhenyu/p/11184467.html