Display a dialog and change the process according to the input selected by the user.
dialog.py
# -*- coding: utf-8 -*-
import tkinter.messagebox as mb
import webbrowser
#If you want to open in chrome
b = webbrowser.get('"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" %s')
if __name__ == '__main__':
#Change processing according to user input
if mb.askyesno("Title", "Open chrome browser?"):
b.open("http://www.yahoo.co.jp")
else:
print("do nothing")
It's easy! The dialog uses ** Tkinter, a toolkit ** that allows you to build a GUI in Python.
Refer to this article. Try using Tkinter in Python
Recommended Posts