-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathTutorialsPoint_PDF_Downloader.py
More file actions
53 lines (39 loc) · 1.38 KB
/
TutorialsPoint_PDF_Downloader.py
File metadata and controls
53 lines (39 loc) · 1.38 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
import wget
from urllib import request
from tkinter import *
import webbrowser
#opening browser
def ref(click):
webbrowser.open_new(r'https://the-vishal.github.io/')
#tkinter front-end
win =Tk()
win.geometry ="400x400"
win.wm_title('TutorialPoint Downloader')
win.config(background = '#708090', height = 600, width = 450)
#retrieve pdf file
def PDF_Download():
global tutorial
tutorial=tutorial_name.get()
try:
PDF_url = 'https://www.tutorialspoint.com/' + tutorial + '/' + tutorial + '_tutorial.pdf'
print(PDF_url)
wget.download(PDF_url)
except:
raise Exception('No such Tutorial Found')
f= Frame(win,height=500, width=150)
f.grid(row=0, column=0,padx=50, pady=50)
tutorial_name = Entry(f, width=70 )
tutorial_name.grid(row=0, column=0)
Get_PDF = Button(f, text =' Download',command = PDF_Download)
Get_PDF.grid(row =0, column =1)
Photo = PhotoImage(file ='tp.png')
Photo0 = PhotoImage(file = 'b.png')
lbl0 = Label(f,image=Photo0)
lbl = Label(f, image = Photo)
lbl.grid(row =5, column =0,padx=10,pady=10)
lbl0.grid(row=4,column=0)
lbl1 = Label(f, text="Created by : the-vishal@github", fg='blue', cursor ="hand2")
lbl1.grid(row =6, column =0,padx=10,pady=10)
lbl1.bind("<Button-1>", ref)
win.mainloop()
#----------------- Completed to Requirement --------------------------------------------