Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as tk
- import webbrowser
- root = tk.Tk()
- root.title("Search")
- root.geometry("600x100")
- def przycisk():
- przycisk = tk.Button(root, text="Find", command=odpal)
- przycisk.grid(pady=2)
- przycisk.config(width=20, height=2)
- przycisk.place(relx=0.38, rely=0.5)
- def okno():
- napis=tk.Label(root, text="I'm looking for: ", font=22, padx=15).grid(row=0)
- wejscie=tk.Entry(root, textvariable=szuk)
- wejscie.grid(row=0, column=1, pady=15)
- wejscie.config(width=47, font=20)
- przycisk()
- szuk = tk.StringVar()
- def odpal():
- url="https://www.google.com/search?q="
- szukane=url+szuk.get()
- webbrowser.open_new_tab(szukane)
- okno()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement