LP by openopt + glpk
# coding:utf-8
import FuncDesigner as fd
from openopt import LP
"""
max. 400x + 300y
sub. 60x+40y <= 3800
20x+30y <= 2100
20x+10y <= 1200
"""
# variables
x, y = fd.oovars(2)
# problem
f = 400*x + 300*y
# startpoirt
startpoint = {x: 0, y: 0}
# subjects
const = []
const.append(60*x+40*y <= 3800)
const.append(20*x+30*y <= 2100)
const.append(20*x+10*y <= 1200)
# create instance
p = LP(f, startpoint, constraints=const, goal="max")
# solve by glpk
r = p.solve("glpk")
# solution
x_opt = r(x, y)
print "Solution: x=%d y=%d" % (x_opt[0], x_opt[1])