Advertisement
GameNationRDF

Academic Search Application Python

Oct 11th, 2013
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.23 KB | None | 0 0
  1. # An academic search application written by Umut Bilgic..
  2. # Version 1.0
  3.  
  4. import webbrowser
  5. import sys
  6. from tkinter import *
  7. from tkinter.ttk import *
  8.  
  9. master = Tk()
  10.  
  11. search_var = IntVar()
  12.  
  13. def button_search_command():
  14.     webbrowser.open("http://scholar.google.com.tr/scholar?hl=tr&q="+entry_search.get())
  15.     webbrowser.open("www.ncbi.nlm.nih.gov/pubmed/?term="+entry_search.get())
  16.     if search_var == 1:
  17.         webbrowser.open("www.google.com/search?q="+entry_search.get())
  18.     else:
  19.         pass
  20.    
  21. def button_clear_command():
  22.     entry_search.delete(0, END)
  23.  
  24. def button_quit_command():
  25.     sys.exit("User hit 'Quit' button. ")
  26.  
  27. button_search = Button(master, text="Search", command = button_search_command)
  28. button_search.grid(row = 0, column = 0)
  29.  
  30. button_clear = Button(master, text="Clear", command = button_clear_command)
  31. button_clear.grid(row = 1, column = 0)
  32.  
  33. button_quit = Button(master, text="Quit", command = button_quit_command)
  34. button_quit.grid(row = 1, column = 1)
  35.  
  36. entry_search = Entry(master)
  37. entry_search.grid(row = 0, column = 1)
  38.  
  39. checkbox_google = Checkbutton(master, text="Search Google", variable = search_var)
  40. checkbox_google.grid(row = 2, column = 0)
  41.  
  42. master.title("Search Tool")
  43. mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement