Python Forum
[Tkinter] Saving images
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Saving images
#8
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):
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?
Reply


Messages In This Thread
Saving images - by Christina - Sep-13-2019, 12:55 PM
RE: Saving images - by Larz60+ - Sep-13-2019, 01:10 PM
RE: Saving images - by Christina - Sep-13-2019, 01:38 PM
RE: Saving images - by Larz60+ - Sep-14-2019, 03:16 AM
RE: Saving images - by Christina - Sep-14-2019, 09:40 PM
RE: Saving images - by Larz60+ - Sep-14-2019, 10:00 PM
RE: Saving images - by Larz60+ - Sep-14-2019, 10:06 PM
RE: Saving images - by Christina - Sep-15-2019, 06:26 PM
RE: Saving images - by Larz60+ - Sep-16-2019, 12:37 AM
RE: Saving images - by buran - Sep-16-2019, 07:02 AM
RE: Saving images - by Christina - Sep-16-2019, 05:59 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020