Python Forum

Full Version: Question window
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, i have python 3.4.3, is it normal when i run this module, nothing happens ?
It is not supposed to create a window ?


# -*- coding: utf-8 -*-
import tkinter


class View :
    def __init__(self,texte="Hello"):
        fenetre = tkinter.Tk()
        fenetre.title("First exemple")
        lbl_message = tkinter.Label(fenetre, 
                           text=texte,
                           fg="red")
        lbl_message.pack()
        btn_quitter = tkinter.Button(fenetre, 
                            text="Goodbye",
                            command = fenetre.destroy) 
        btn_quitter.pack()
        fenetre.mainloop()


if __name__ == '__main__' :
    mon_appli = View("I hope you have a good holiday")
It works fine on my system
It does create a small window

How exactly did you run it?
python version
os