Opening a URL from Tkinter

0

Is it possible to link a site using Python code? For example, in a menu made in Tkinter (Object Orientation) I wanted to click the button and be redirected to a website.

    
asked by anonymous 07.12.2018 / 15:24

1 answer

1

Python has the webbrowser package natively. In this module there is a open function that can be used to open a URL through of the user's default browser.

Since you did not introduce us any code, I leave a simple example of how it would be to open the URL at the push of a button:

button = Button(frame, text="Abrir URL", command=lambda: webbrowser.open('SUA URL AQUI'))
    
07.12.2018 / 15:43