Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pyperclip
- import webbrowser
- import tkinter as tk
- def google_input(inp):
- webbrowser.open("https://google.com/search?q=%s" % inp)
- pass
- def google_clipboard():
- copied_query = pyperclip.paste()
- webbrowser.open("https://google.com/search?q=%s" % copied_query)
- pass
- root= tk.Tk()
- canvas1 = tk.Canvas(root, width = 400, height = 300)
- canvas1.pack(fill = "both", expand= True)
- entry1 = tk.Entry (root)
- canvas1.create_window(200, 140, window=entry1)
- canvas1.config(background="#024897")
- def google_entry():
- entry_information = entry1.get()
- if entry_information == '':
- google_clipboard()
- else:
- google_input(entry_information)
- button1 = tk.Button(text='Search Google', command=google_entry)
- canvas1.create_window(200, 180, window=button1)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement