Created
July 17, 2016 08:57
-
-
Save RandomResourceWeb/93e887facdb98937ab5d260d1a0df270 to your computer and use it in GitHub Desktop.
How to open a link through a tkinter button in Python
its working
Indeed, its working with Python3 and also with from Tkinter import *
at line 6 wih Python2. Maybe you have some utf8 coding problems with that copyright sign.
is there a way to put a box to type a link I want it to go too
is there a way to put a box to type a link I want it to go too
Hi, yea
- Add this piece of code after the openweb function (All it does it add an entry widget so you can enter a line of text)
link = Entry(root)
link.pack()
- And then replace
url
in the openweb function tolink.get()
(Which gets the value of the entry widget instead of the hard-coded url)
Hope this helped!
This is awesome! Thanks! You got a star.
Thank you <3
This is what I wanted. Thanks mate....
Me sirvió para mi proyecto muchas gracias!
Thank you !
can you guys try the same with custom tkinter? it doesn't seem to work as i intended
is there a way to add this with radio buttons, like if optionA is selected it opens linkA... ect ect?
@ldrak20 Well yes, the important part is the use of webbrowser.open
function. You can call it from wherever you'd like.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, I just re-ran this code and it should definitely be working!