Hey Python Programmers...

I try to create an image editor, to test my python knowledge.... but i get two problems:
1) The Filters in images are not showing...
2) The image (img.) you save is empty... (see def export() function)...


This is my script:
Code:
from tkinter import *
from tkinter import ttk
from tkinter.filedialog import askopenfilename, asksaveasfile
from PIL import Image, ImageTk
from PIL import ImageFilter

main = Tk()

filename_error = 'No File Imported...'


def Open():
    folder = askopenfilename(parent = main, initialdir = 'C:/', filetypes = [('PNG Files', '*.png')], title = "Open File")

    try:
        with open(folder) as filename:

            listbox.insert(END, str(filename.name))
            print(filename.name)

            img = Image.open(folder)
            showimage = ImageTk.PhotoImage(img)
            photo = Label(main, image = showimage)
            photo.image = showimage
            photo.pack(padx = 10, pady = 12, side = RIGHT)
            

            def tool_Blur():

                try:
                    blur_filter = img.filter(ImageFilter.BLUR)
                    show = ImageTk.PhotoImage(img)
                    blur = Label(main, image = show)
                    blur.image = show
                    blur.pack(padx = 10, pady = 12, side = RIGHT)
                    print('Tools/Blur: ', img.filter)

                except:
                    print('Tools/Blur: ', filename_error)

            def tool_Emboss():
    
                try:
                    emb_filter = img.filter(ImageFilter.EMBOSS)
                    show = ImageTk.PhotoImage(img)
                    emb = Label(main, image = show)
                    emb.image = show
                    emb.pack(padx = 10, pady = 12, side = RIGHT)
                    print('Tools/Emboss: ', img.filter)

                except:
                    print('Tools/Emboss: ', filename_error)

            def tool_Contour():

                try:
                    cont_filter = img.filter(ImageFilter.CONTOUR)
                    show = ImageTk.PhotoImage(img)
                    cont = Label(main, image = show)
                    cont.image = show
                    cont.pack(padx = 10, pady = 12, side = RIGHT)
                    print('Tools/Contour: ', img.filter)
        
                except:
                    print('Tools/Contour: ', filename_error)

            def Export():
                output = asksaveasfile(mode = 'w', parent = main, initialdir = 'C:/', filetypes = [('PNG Files', '*.png')], title = 'Export File')

                try:
                    print(saveimage)

                    saveimage = img.save(output, filetypes).convert('RGB')
                    saveimage.write(output)

                    with open(output, mode) as savedfile:
                        print('Saved: ', savedfile.name)

                    saveimage.close()

                        

                except:
                    print('Images not Saved...')




            exp = Menu(menu, tearoff=0)
            exp.add_command(label = 'Export', command = Export)
            menu.add_cascade(label = 'Image', menu = exp)

            tool = Menu(menu, tearoff=0)
            tool.add_command(label = 'Blur', command = tool_Blur)
            tool.add_command(label = 'Emboss', command = tool_Emboss)
            tool.add_command(label = 'Contour', command = tool_Contour)
            menu.add_cascade(label = 'Tools', menu = tool)

    except:
        print('File not Exit...')
    

def Exit():
    print("Exit...")
    exit()


Title = main.title('AVI File Loader')
label = ttk.Label(main, text = 'Load Movies')
label.pack()

menu = Menu(main)
main.geometry("150x250+300+300")

file_label = Label(main, text = 'Files')
file_label.pack()

file = Menu(menu, tearoff=0)
file.add_command(label = 'Open', command = Open)
file.add_command(label = 'Exit', command = Exit)
menu.add_cascade(label = 'File', menu = file)

main.config(menu=menu)


scrollbar = Scrollbar(main, orient = VERTICAL)
scrollbar.pack(side = LEFT)

listbox = Listbox(main, yscrollcommand = scrollbar.set)
listbox.pack(padx = 4, pady = 16, side = LEFT)
scrollbar.config(command = listbox.yview)



main.mainloop()
Can anyone correct my code, pleace... so i can expiriment with it ?...
Can you fix the two problems... just first test my program and see what the problems
are ?... to give me the just code ?... The image thad you save with my export menu tool
is just empty... it must be the edited image img. ... Can you fix the two problems ?...

Thanks for help, Jamie.