I made an app that opens urls in a web browser, when you enter them into a gui.
from tkinter import *
import webbrowser
def WebOpen():
url = (WebEntry.get())
webbrowser.open(url)
gui = Tk()
gui.after(1, lambda: gui.focus_force)
gui.geometry("1920x1040")
gui.resizable(False, False)
gui.attributes('-fullscreen',True)
gui.configure(bg="black")
ExitWindow = Label(gui, text="To Quit This Computer Application, On Your Keyboard, Press and Hold the ALT and the F4 keys at the bottom and top of your keyboard respectively.", fg="white", bg="black", font="arial, 21")
ExitWindow.place(x=30,y=5)
WebEntry = Entry(gui, font="arial, 21")
WebEntry.place(x=100,y=400)
WebButton = Button(gui, text="Take Me There!",font="arial, 21",command=WebOpen())
WebButton.place(x=200, y=500)
gui.mainloop()
I tried to use webbrowser and tkinter to make an app that opens a webpage, but as soon as my program started, it opened file explorer (I think because of an empty path or something.)
command=WebOpen(). The purpose of thecommandargument is to give the name of a function to be called later. But because you included the parentheses()after the function, it is called immediately when the button is created. I think you should usecommand=WebOpeninstead, without the parentheses.