-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBrowse.py
44 lines (31 loc) · 1.43 KB
/
Browse.py
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
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
import PDFMerg
file = open('PDFMerg.txt','w')
class Root(Tk):
def __init__(Shivam):
super(Root, Shivam).__init__()
Shivam.title("PDF Merg")
Shivam.minsize(5, 5)
Shivam.labelFrame = ttk.LabelFrame(Shivam, text = "Open File")
Shivam.labelFrame.grid(column = 0, row = 1, padx = 20, pady = 20)
Shivam.labelFrame2=ttk.LabelFrame(Shivam, text = "OK")
Shivam.labelFrame2.grid(column = 2, row = 1, padx = 20, pady = 20)
Shivam.button()
def button(Shivam):
Shivam.button = ttk.Button(Shivam.labelFrame, text = "Browse A File",command = Shivam.fileDialog)
Shivam.button.grid(column = 1, row = 1)
Shivam.button2 = ttk.Button(Shivam.labelFrame2, text = "Done",command = Shivam.destroy)
Shivam.button2.grid(column = 3, row = 1)
def fileDialog(Shivam):
path=[]
Shivam.filename = filedialog.askopenfilename(initialdir = "/", title = "Select A File", filetype =[("PDF files","*.pdf")])
Shivam.label = ttk.Label(Shivam.labelFrame, text = "")
path.append('"'+Shivam.filename+'",')
Shivam.label.grid(column = 1, row = 2)
Shivam.label.configure(text = Shivam.filename)
for i in path:
PDFMerg.write(path)
root = Root()
root.mainloop()