#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Copyright (c) 2012,2015 Jérémie DECOCK (http://www.jdhp.org)

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

# See also 'display_gif_images_with_pil.py'

import tkinter as tk

def main():
    """Main function"""

    root = tk.Tk()

    img = tk.PhotoImage(file="jdhp_logo.png")

    label = tk.Label(root, image=img)
    label.pack()

    root.mainloop()

if __name__ == '__main__':
    main()

@@ -1231,49 +1231,316 @@
 tk%0A%0A
-def main():%0A    %22%22%22Main function%22%22%22%0A%0A    
+if tk.TkVersion %3C 8.6:%0A    print(%22*%22 * 80)%0A    print(%22WARNING: Tk version %7B%7D is installed on your system.%22.format(tk.TkVersion))%0A    print(%22Tk %3C 8.6 only supports three file formats: GIF, PGM and PPM.%22)%0A    print(%22You need to install Tk %3E= 8.6 if you want to read JPEG and PNG images!%22)%0A    print(%22*%22 * 80)%0A%0A
 root
@@ -1551,20 +1551,16 @@
 k.Tk()%0A%0A
-    
 img = tk
@@ -1594,20 +1594,16 @@
 .png%22)%0A%0A
-    
 label = 
@@ -1628,20 +1628,16 @@
 ge=img)%0A
-    
 label.pa
@@ -1642,20 +1642,16 @@
 pack()%0A%0A
-    
 root.mai
@@ -1662,43 +1662,4 @@
 p()%0A
-%0Aif __name__ == '__main__':%0A    main()%0A

Improve a snippet.