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

from tkinter import *

def convertir ():
    resultat.set(bin(int(entree.get())))
# end def

fenetre = Tk()
Label(fenetre, text="Entrez un nombre entier:").pack()
entree = Entry(fenetre)
entree.pack()
Label(fenetre, text="Résultat de la conversion:").pack()
resultat = StringVar()
Label(fenetre, textvariable=resultat).pack()

# command=callback attend un NOM de fonction
# et NON PAS la valeur retour d'une fonction

Button(fenetre, text="Convertir", command=convertir()).pack() # ERREUR!

# remplacez par :

Button(fenetre, text="Convertir", command=convertir).pack() # CORRECT

fenetre.mainloop()
