from gurobipy import *
a_var = m.addVar(name='variable.0')
a_var_reference = m.getVarByName('variable.0')
m.optimize()
if m.Status == GRB.OPTIMAL:
    pass
Gurobi python get value of the defined variable