def readsol(self, filename):
    'Read a Gurobi solution file'
    with open(filename) as my_file:
        try:
            next(my_file)
        except StopIteration:
            warnings.warn('GUROBI_CMD does provide good solution status of non optimal solutions')
            status = constants.LpStatusNotSolved
            return (status, {}, {}, {}, {})
        status = constants.LpStatusOptimal
        shadowPrices = {}
        slacks = {}
        shadowPrices = {}
        slacks = {}
        values = {}
        reducedCosts = {}
        for line in my_file:
            if (line[0] != '#'):
                (name, value) = line.split()
                values[name] = float(value)
    return (status, values, reducedCosts, shadowPrices, slacks)
Read a Gurobi solution file
def readsol(self, filename):
    
    with open(filename) as my_file:
        try:
            next(my_file)
        except StopIteration:
            warnings.warn('GUROBI_CMD does provide good solution status of non optimal solutions')
            status = constants.LpStatusNotSolved
            return (status, {}, {}, {}, {})
        status = constants.LpStatusOptimal
        shadowPrices = {}
        slacks = {}
        shadowPrices = {}
        slacks = {}
        values = {}
        reducedCosts = {}
        for line in my_file:
            if (line[0] != '#'):
                (name, value) = line.split()
                values[name] = float(value)
    return (status, values, reducedCosts, shadowPrices, slacks)