Po dlhom čase som sa vrátil späť ku Pythonu a pozeral geonove lekcie.
Skončil som na 24..
Po nainštaloval python-imaging (PIL), mi v ňom chýbal ImageTk, tak som ho tam doplnil zo stiahnutej verzie.
Import prebehol úspešne no pri pokuse ImageTk.PhotoImage(obr) dostanem:
/usr/lib/python2.5/site-packages/PIL/Image.py:1268: DeprecationWarning: integer argument expected, got float
im = self.im.resize(size, resample)
Traceback (most recent call last):
File "/home/ikarus2/Dokumenty/Python/Tk_obrazkovac.py", line 42, in <module>
zobrazObrazok(cesta)
File "/home/ikarus2/Dokumenty/Python/Tk_obrazkovac.py", line 22, in zobrazObrazok
photo = ImageTk.PhotoImage(obr)
File "/usr/lib/python2.5/site-packages/PIL/ImageTk.py", line 113, in __init__
self.__photo = apply(Tkinter.PhotoImage, (), kw)
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 3273, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 3214, in __init__
raise RuntimeError, 'Too early to create image'
RuntimeError: Too early to create image
Exception exceptions.AttributeError: "PhotoImage instance has no attribute '_PhotoImage__photo'" in <bound method PhotoImage.__del__ of <PIL.ImageTk.PhotoImage instance at 0xb706a92c>> ignored
Neviem v čom je chyba.. Skoro nekoro, malo by to fungovať.
Nevie niekto, ako to vyriešiť? Ďakujem.