Advertisement
Guest User

Untitled

a guest
Jun 29th, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. import tkinter as tk
  2. import webbrowser
  3.  
  4. root = tk.Tk()
  5. root.title("Search")
  6. root.geometry("600x100")
  7.  
  8. def przycisk():
  9.     przycisk = tk.Button(root, text="Find", command=odpal)
  10.     przycisk.grid(pady=2)
  11.     przycisk.config(width=20, height=2)
  12.     przycisk.place(relx=0.38, rely=0.5)
  13.  
  14. def okno():
  15.     napis=tk.Label(root, text="I'm looking for: ", font=22, padx=15).grid(row=0)
  16.     wejscie=tk.Entry(root, textvariable=szuk)
  17.     wejscie.grid(row=0, column=1, pady=15)
  18.     wejscie.config(width=47, font=20)
  19.     przycisk()
  20.  
  21. szuk = tk.StringVar()
  22.  
  23. def odpal():
  24.     url="https://www.google.com/search?q="
  25.     szukane=url+szuk.get()
  26.     webbrowser.open_new_tab(szukane)
  27.  
  28. okno()
  29. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement