-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgui.py
More file actions
81 lines (56 loc) · 1.68 KB
/
Copy pathgui.py
File metadata and controls
81 lines (56 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
from tkinter import *
from spider import Spider
import webbrowser
"""
Note: print all PDFs as hyperlinks after the app is done
import webbrowser
def callback(event):
webbrowser.open_new(r"http://www.google.com")
root = Tk()
link = Label(root, text="Google Hyperlink", fg="blue", cursor="hand2")
link.pack()
link.bind("<Button-1>", callback)
root.mainloop()
OR
from tkinter import *
import webbrowser
root = Tk()
link = Label(root, text="http://stackoverflow.com", fg="blue", cursor="hand2")
link.pack()
link.bind("<Button-1>", lambda event: webbrowser.open(link.cget("text")))
root.mainloop()
"""
def run():
root = Tk()
root.title("PDF-Scrapper")
root.geometry("800x300") # original: 300x100
# methods
def search():
data = str(search_data.get())
spider = Spider(data)
spider.gather_pdfs()
<<<<<<< Updated upstream
# spider.sort_pdfs()
=======
#spider.sort_pdfs()
>>>>>>> Stashed changes
notification_label = Label(root, text="You Can Copy the Links")
notification_label.grid(row=3)
pdf_text = Text(root, fg="blue")
for pdf in spider.pdfs:
pdf_text.insert(END, '- ' + pdf + '\n\n')
pdf_text.grid(row=4)
# entries
search_data = StringVar()
search_entry = Entry(root, textvariable=search_data)
# labels
search_label = Label(root, text='Enter the PDF you want to search here')
# buttons
search_button = Button(root, text="Search", command=search)
# grid layout
search_label.grid(row=0, column=0)
search_entry.grid(row=1, column=0)
search_button.grid(row=1, column=1)
root.mainloop()
if __name__ == '__main__':
run()