# Document Viewer # Designed to view documents from Tkinter import * import tkFileDialog master = Tk() master.geometry("900x600") master.title("Document Viewer") def open_command(): file = tkFileDialog.askopenfile(mode='rb',title="Select desired file") if file != None: contents = file.read() contents_display = Text(width=900) contents_display.delete(1.0, END) contents_display.insert(END, contents) contents_display.config(state='disabled') contents_display.pack() file.close() open_document = Button(text="Open Document", command=open_command) open_document.pack() master.mainloop()
Only works in Python 2 at the moment, but will be ported over to Python 3.5 soon.
I hope you like my sample!
Epic Chas Gamer 😎
nice
LikeLiked by 1 person
Thx!
LikeLike