Maybe I didn't make it clear. I'm writing my app in tkinter and I used tkinter filedialog (from tkinter.filedialog import asksaveasfilename). My code is like this (I wrote it in my first post):
Please do you know some function or options which can save selected suffix (in my examle PNG .png) and add it to variable a?
a = photo.filename = asksaveasfilename(initialdir = "/",title = "Select file",filetypes = (('JPEG', ('*.jpg','*.jpeg','*.jpe','*.jfif')),('PNG', '*.png'),('BMP', ('*.bmp','*.jdib')),('GIF', '*.gif'))) photo.save(a)User can select suffix (in GUI mode - Windows) JPEG, PNG, BMP or GIF but the selected suffix is not saved and app throws out error. In variable a is saved for example C:\Photos\Photo012 but I need save to a suffix. In variable a should be for example C:\Photos\Photo012.png
Please do you know some function or options which can save selected suffix (in my examle PNG .png) and add it to variable a?