I'm trying to open a file via my python project, but it doesn't work.. Is there any reason why?
import os
from tkinter import *
from tkinter import filedialog
from PIL import ImageTk,Image
def openfile():
window.filename = filedialog.askopenfilename(initialdir="Open file", filetypes=(("exe files", "*.exe"),("all files", "*.*"))
file_opener = open(window.filename)
file_opener.read()
Button = Button(window, text="Open", command=openfile)
Button.pack()