#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0

    Eclipse ImagePhoto


    Hi
    I wrote this tkinter code, but it doesn't work and shows error in eclipse:
    ................................
    Traceback (most recent call last):
    File "C:\Users\farshad\workspace\python3test\src\email.py", line 5, in <module>
    logo = PhotoImage(file="c://Python32/1.gif")
    File "C:\Python32\lib\tkinter\__init__.py", line 3228, in __init__
    Image.__init__(self, 'photo', name, cnf, master, **kw)
    File "C:\Python32\lib\tkinter\__init__.py", line 3184, in __init__
    self.tk.call(('image', 'create', imgtype, name,) + options)
    _tkinter.TclError: couldn't recognize data in image file "c://Python32/1.gif"

    ............................
    from tkinter import *

    root = Tk()
    logo = PhotoImage(file="c://Python32/1.gif")
    w1 = Label(root, image=logo).pack(side="right")
    explanation = """At present, only GIF and PPM/PGM
    formats are supported, but an interface
    exists to allow additional image file
    formats to be added easily."""
    w2 = Label(root,
    justify=LEFT,
    padx = 40,
    text=explanation).pack(side="left")
    root.mainloop()
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,840
    Rep Power
    480
    Your program works fine when presented with an actual gif format file.

    Perhaps you need to mime parse the email to first extract the picture?
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    3
    Rep Power
    0

    Re


    actually, this cod works in python3.2 but it doesn't work in eclipse... would you please tell me what should I do?
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,840
    Rep Power
    480
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    3
    Rep Power
    0

    Re


    Then you mean that Emacs is better and more flexible?
    Thanks for your guidance
  10. #6
  11. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,840
    Rep Power
    480
    I know little about eclipse, however emacs comes with a symbolic calculator, artist mode, various computer language modes, built in support for gdb, mail, diary, eliza (M-x doctor), rectangle editing support, keyboard macros, on and on and on, emacs can open windows on multiple display servers all of which can access same buffer and therefor can be used for non-local meetings.
    [code]Code tags[/code] are essential for python code and Makefiles!
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    3
    Rep Power
    0

    re


    Thanks for your time ...

IMN logo majestic logo threadwatch logo seochat tools logo