I'm looking to make a three way message box in tkinter. Something like, "do you want chocolate milk, lemonade, or sprite" and then buttons for each of the 3 at the bottom. As an aside, is it possible to make python "knock out" numbers when counting. So say I'm adding counting from 10 to 60, could I make python skip over every 7 and 8?
(1) By message box do you mean something like this? http://www.java2s.com/Code/Python/GUI-Tk/Creatingasimpledialog.htm
for i in range(6): for j in range(10): if j in [7,8]: continue print i*10+j
prints all numbers 0-59 skipping if it ends in 7 or 8.
You can use PyMsgBox to do this. Install it with
pip install pymsgbox. The documentation is at https://pymsgbox.readthedocs.io/en/latest/
The code to do your example is:
>>> import pymsgbox >>> drink_choice = pymsgbox.confirm('What drink do you want?', 'Title', ['Chocolate milk', 'Lemonade', 'Sprite'])