Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import tkinter as tk
- import tkinter.simpledialog as sd
- import tkinter.messagebox as mb
- class main_window(tk.Frame):
- def askstr(self, message="文字を入力してください", default="", title=" "):
- return sd.askstring(title, message, initialvalue=default)
- def askokcancel(self, message="「はい」でTrue 「キャンセル」でFalseが返ります", title=" "):
- return mb.askokcancel(title,message)
- def msgbox(message="「はい」でTrue 「キャンセル」でFalseが返ります",title=" "):
- root = tk.Tk()
- root.wait_visibility()
- root.withdraw()
- mw = main_window(root)
- return mw.askokcancel(message,title)
- def inputbox(message="文字を入力してください", default="", title=" "):
- root = tk.Tk()
- root.wait_visibility()
- root.withdraw()
- mw = main_window(root)
- return mw.askstr(message, default, title)
- print(msgbox())
- print(inputbox())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement