Skip to main content

Suppress console outputs

Answered

Comments

3 comments

  • Simranjit Kaur
    Gurobi Staff Gurobi Staff

    Hi Xinshuo,

    To suppress all output, you can set the OutputFlag parameter to 0 in your environment. Alternatively, you can direct the log to a file without printing it to the console by setting the LogToConsole parameter to 0 in your environment.  For example,

    import gurobipy as gp

    #create an environment
    env = gp.Env()

    # set parameters to supress outputs
    env.setParam("OutputFlag",0) # supress all outputs
    #env.setParam("LogToConsole",0) # supress console outputs only

    # use the env when reading the model m = gp.read("glass4.mps", env)

    Regards,

    Simran

    0
  • Gwyneth Butera
    Gurobi Staff Gurobi Staff

    I have updated the article How do I suppress all console output from Gurobi? to include an example of reading a model from a file.

    0
  • Xinshuo Yang
    Gurobi-versary
    Curious
    First Comment

    Thank you very much.

    0

Please sign in to leave a comment.