Récupérer la variable d'une fonction précédente
Bonjour à tous,
Je suis complétement bloqué !
J'ai un soucis, je cherche à récupérer la variable tabdia de la fonction pro :
Voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| from tkinter import *
import Pmw
import math
import xlrd
classeur = xlrd.open_workbook("Tableau diametre.xlsx")
nom_des_feuilles = classeur.sheet_names()
feuille = classeur.sheet_by_name(nom_des_feuilles[0])
tabdia=[]
def pro():
if ba.get()==1 :
for x in range (2, 22) :
tabdia.append(feuille.cell_value(x, 0))
elif bna.get()==1 :
for x in range (2, 10) :
tabdia.append(feuille.cell_value(x, 3))
elif font.get()==1 :
for x in range (2, 24) :
tabdia.append(feuille.cell_value(x, 6))
elif gres.get()==1 :
for x in range (2, 22) :
tabdia.append(feuille.cell_value(x, 9))
elif pehd.get()==1 :
for x in range (2, 22) :
tabdia.append(feuille.cell_value(x, 13))
combo = Pmw.ComboBox(Fenetre, labelpos = NW,
label_text = 'Choisissez le diamètre nominal (DN) :',
scrolledlist_items = 'Je voudrais récupérer la variable de tabdia de la fonction pro précédente',
listheight = 150)
combo.grid(row =15, columnspan =2, padx =10, pady =1) |
Je vous remercie d'avance ;)