EasyGUI学习

官网:http://easygui.sourceforge.net/tutorial.html#using-easygui

In [14]: import easygui

In [15]: easygui.msgbox("Hello, world!")

Out[15]: 'OK'

官方示例

from easygui import *

msgbox("Hello, world!")

 python3 学习之路2python3 学习之路2

In [17]: from easygui import *

In [18]: msg = "Do you want to continue?"

In [19]: title = "Please Confirm"

In [20]: if ccbox(msg, title):

    ...: pass

    ...: else:

    ...: sys.exit(0)

 python3 学习之路2python3 学习之路2

以下为官方实例

from easygui import *

msgbox("Hello, world!")

 

msg ="What is your favorite flavor?"

title = "Ice Cream Survey"

choices = ["Vanilla", "Chocolate", "Strawberry", "Rocky Road"]

choice = choicebox(msg, title, choices)

 

    # note that we convert choice to string, in case

    # the user cancelled the choice, and we got None.

msgbox("You chose: " + str(choice), "Survey Result")

 

msg = "Do you want to continue?"

title = "Please Confirm"

if ccbox(msg, title):     # show a Continue/Cancel dialog

    pass  # user chose Continue

else:

    sys.exit(0)           # user chose Cancel

 python3 学习之路2python3 学习之路2

 python3 学习之路2python3 学习之路2

 python3 学习之路2python3 学习之路2

 python3 学习之路2python3 学习之路2

In [41]:from easygui import *

In [42]: image = "F:\\resizeApi.gif"

In [43]: msg = "Do you like this picture?"

In [44]: choices = ["Yes","No","No opinion"]

In [45]: reply = buttonbox(msg, image=image, choices=choices)

python3 学习之路2python3 学习之路2

相关文章:

  • 2021-11-08
  • 2022-01-10
  • 2021-10-29
  • 2022-01-16
  • 2022-12-23
  • 2021-10-01
  • 2021-12-09
  • 2022-03-02
猜你喜欢
  • 2021-11-11
  • 2021-06-26
  • 2021-07-01
  • 2021-09-15
  • 2021-11-07
  • 2022-01-09
  • 2021-06-03
相关资源
相似解决方案