Partage
  • Partager sur Facebook
  • Partager sur Twitter

tableau avec Tkinter

    12 mai 2021 à 1:14:26

    salut, s'il vous plait, je veux afficher un tableau Excel dans un tableau d'une interface graphique faite par Tkinter python, sans passer par le processus d'ouvrir un dossier et sélectionner le fichier Excel. 
    je veux que le tableau excel soit affichée directement sur le tableau tkinter après l'exécution de l'interface. J'ai utilisé la méthode insert mais cela ne fonctionne pas.
    tableau = ttk.Treeview(fra1, columns= (1,2,3,4,5), height =5,show= "headings")
                tableau.place(relheight=1,relwidth=1)
                
                # 
                tableau.heading(1, text="ID")
                tableau.heading(2, text="Code machine")
                tableau.heading(3, text="designiation")
                tableau.heading(4, text="M_fonctionnement")
                tableau.heading(5, text="M_A")
                # 
                tableau.column(1,width=50)
                tableau.column(2,width=100)
    
                treescrolly = Scrollbar(fra1, orient="vertical", command=tableau.yview) 
                treescrollx = Scrollbar(fra1, orient="horizontal", command=tableau.xview) 
                tableau.configure(xscrollcommand=treescrollx.set, yscrollcommand=treescrolly.set) 
                treescrollx.pack(side="bottom", fill="x") 
                treescrolly.pack(side="right", fill="y")
    
                data='machine.xlsx'                
                df=pd.read_excel(data)            
                tableau.insert('','end',values=df)
    

    -
    Edité par Safae Kz 12 mai 2021 à 1:15:51

    • Partager sur Facebook
    • Partager sur Twitter
      12 mai 2021 à 13:06:52

      hop un petit tuto vidéo trouvé en 10s > https://www.youtube.com/watch?v=Bn1n1diGv_0

      -
      Edité par umfred 12 mai 2021 à 13:07:03

      • Partager sur Facebook
      • Partager sur Twitter

      tableau avec Tkinter

      × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
      × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
      • Editeur
      • Markdown