/Demo/tkinter/guido/imageview.py

http://unladen-swallow.googlecode.com/ · Python · 12 lines · 10 code · 2 blank · 0 comment · 0 complexity · 5ac49057e0d160ff9a74a08db404b495 MD5 · raw file

  1. from Tkinter import *
  2. import sys
  3. def main():
  4. filename = sys.argv[1]
  5. root = Tk()
  6. img = PhotoImage(file=filename)
  7. label = Label(root, image=img)
  8. label.pack()
  9. root.mainloop()
  10. main()