Récupérer la valeur courante d'une variable globale d'un module dans un autre module
Bonsoir,
j'ai deux modules python :
a.py
b.py
a.py
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
import b
def createTable():
global table
for j in range(8):
table[j].append([])
for i in range(8):
table[j][i].append(0)
table=[]
createTable()
b.verify() |
b.py
Code:
1 2 3 4 5
| import a
def verify():
if a.table[2][4]:
print 'ok' |
La fonction verify renvoie index out of range.
La variable a.table ne prends donc pas en considération les modifications apportées par createTable.
Comment récupérer la valeur courante de a.table ?
Merci