HiGHS is available as
highspy on PyPi.
highspy is not already installed, run:
$ pip install highspy
highspy within a Python program, it must be imported
highspy, it is likely that
numpy structures will be needed, so must also be imported
import numpy as np
HiGHS must be initialized before making calls to the HiGHS Python library:
h = highspy.Highs()
Detailed documentation of the methods and structures is given in the examples section.
Unless a method just returns data from HiGHS, so is guaranteed to run successfully, each method returns a status to indicate whether it has run successfully. This value is an instance of the enum HighsStatus, and in the examples section, it is referred to as
The following Python code reads a model from the file
model.mps, and then solves it.
import highspy h = highspy.Highs() filename = 'model.mps' h.readModel(filename) h.run() print('Model ', filename, ' has status ', h.getModelStatus())