Python Forum
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help for python and cplex
#1
Hello everyone,
I have a model built on cplex but I want to call its solution to python . I applied template below; Can you tell me where I should indicate the name of the model and data I want to work ? Thanks in advance
[import cplex
import sys
def sample1(filename):
c=cplex.Cplex(filename)
try:
c.solve()
except CplexSolverError:
print "Exception raised during solve"
return
status=c.solution.get_status()
print "Solution Status=", status,":",
print c.solution.status[status]
print "Objective value=",c.solution.get_objective_value()]
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020