Python Forum
generate filename of value and extend
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
generate filename of value and extend
#1
from PIL import Image
import sys

rr = input('R > code: ')
gg = input('G > code: ')
bb = input('B > code: ')
 
filename = ( str(rr)+str(gg)+str(bb)  )
suffix =  ".png"

im.save("/home/marre/XY-Kordinaterna/PAINT_BILDER/filename + suffix")
#----------------------------------------------------------------------------
inserted values to the program

R > code: 1
G > code: 2
B > code: 3

my result: filename + suffix = 123.png

I get a error message that i cant understand
Error:
Traceback (most recent call last): File "/home/marre/XY-Kordinaterna/4_från_cluster_EN_FÄRG_test.py", line 48, in <module> im.save("/home/marre/XY-Kordinaterna/PAINT_BILDER/filename + suffix") File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1662, in save format = EXTENSION[ext] KeyError: ''
I an greatfull for help
br Marre
Reply


Messages In This Thread
generate filename of value and extend - by Marre - Oct-01-2018, 01:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  View and extend native python class PythonDev 2 1,679 Oct-24-2020, 08:59 PM
Last Post: Gribouillis
  Why the this extend example is printing 2 two times? sbabu 1 1,501 Jan-12-2020, 07:30 AM
Last Post: Gribouillis
  How to extend the sclale of a graph? Krszt 1 2,350 Nov-13-2018, 11:16 AM
Last Post: Larz60+
  Extend the scale Krszt 1 2,726 Nov-05-2018, 01:16 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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