In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you a sample analysis of the python graphical user interface, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Graphical user interface of python
Python's graphical user interface msgbox's use of ccbox's use of buttonbox's use of buttonbox to add pictures multchoicebox's use
The use of msgbox
The magbox () function displays a message and a button that provides an ok
Example 1:
Import easygui as AXAX.msgbox ("Hi, welcome to the\ nfirst\ ninterface Mini Game", "zhaojie")
The use of ccbox
The ccbox () function provides a choice: C [o] ntinue or C [a] ncel (press keyboard'o' or keyboard'a 'instead of mouse operation, and the letters enclosed in [] are the corresponding keys. Of course, continue and cancel can also be designed according to their own needs)
Example 2:
Import easygui as AXimport sys msg = "excuse me, are you handsome?" title = "Magic Mirror" choices = ('yes ([y])', 'not ([n])') AX.ccbox (msg, title,choices)
The use of buttonbox
The usage of the buttonbox () function:
Buttonbox (msg =', title ='', choices = ('button [1]', 'butthon [2]', 'button [3]'), image=None,default_choice=None,cancel_choice=None,callback=None,run=True) example 3:import easygui as AXimport sys### is written 1###msg ='am I a handsome guy?' Title = 'Magic Mirror' choices = ('handsome ([1]),' very handsome ([2]), 'the most handsome ([3])') AX.buttonbox (msg,title,choices) # write 2###AX.buttonbox (msg ='am I a handsome guy?' , title = 'Magic Mirror', choices = ('handsome ([1])', 'very handsome ([2])', 'most handsome ([3])'), image=None,default_choice=None,cancel_choice=None,callback=None,run=True)
Buttonbox add Picture
Display pictures in buttonbox:
Notice that image = None in the buttonbox function above, so you just need to change None to the corresponding picture
Import easygui as AXimport sys#### writes 1####msg ='am I a handsome guy?' Title = 'Magic Mirror' choices = ('handsome ([1])', 'very handsome ([2])', 'most handsome ([3])') image = 'OIP-C.jpg'AX.buttonbox (msg,title,choices,image) # write 2###AX.buttonbox (msg =' am I handsome?' , title = 'Magic Mirror', choices = ('handsome ([1])', 'very handsome ([2])', 'most handsome ([3])'), image='OIP-C.jpg',default_choice=None,cancel_choice=None,callback=None,run=True)
The use of choicebox
Use of choicebox:
The choicebox (msg='',title='',choices= [], preselect=0,callback=None,run=True) choicebox () function provides a list of choices, import easygui as AXimport sysAX.choicebox (msg=', who is the handsome guy?' Title=' touched his conscience and said,', choices= [Sun Xing, Sun Xing, Sun Xing Sun], preselect=0,callback=None,run=True)
The use of multchoicebox
The usage of multchoicebox:
Like choicebox, multiple choices are supported
Import easygui as AXimport sysAX.multchoicebox (msg=', who is the handsome guy?' Title=' touched his conscience and said,', choices= [Sun Xing, Sun Xing, Sun Xing Sun], preselect=0,callback=None,run=True)
The above is all the contents of the article "sample Analysis of python graphical user Interface". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.