redirecting to a website using a button (kivy)

Asked

Viewed 64 times

0

Hello ! I’m making a simple application, but it needs a redirect to a specific site ! Example: With just one touch, the button redirects the user to Youtube ! I am making my desktop application, using Pycharm, more oriented to KV file... If you know anything similar in the documentation, a code on Github, or any questions answered by Reddit, do not hesitate to speak to me! Thank you !

1 answer

0

You can use webbrowser Example:

import webbrowser

def abrir_site(*args):

 site = 'https://www.youtube.com'
 webbrowser.open_new(site)


botao = Button(text='You Tube',on_release=abrir_site)


class app(App):

 def build(self): return botao

app().run()

Browser other questions tagged

You are not signed in. Login or sign up in order to post.