Skip to content

Commit

Permalink
add Python syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
ojdo authored Nov 22, 2016
1 parent 50abfb2 commit 6c29c4c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ While for this example, the scaffolding code seems unnecessarily complex, it sca

For a better learning experience, one can also launch `ipython` and execute the lines of `runme.py` step by step, inspecting the created objects with one eye on the [Pyomo Online Documentation](https://software.sandia.gov/downloads/pub/pyomo/PyomoOnlineDocs.html):

import coopr.environ
from coopr.opt.base import SolverFactory
import bacon

data = bacon.read_excel('input.xlsx')
model = bacon.create_model(data)
prob = model.create()
optim = SolverFactory('glpk')
result = optim.solve(prob, tee=True)
prob.load(result)
```python
import coopr.environ
from coopr.opt.base import SolverFactory
import bacon

data = bacon.read_excel('input.xlsx')
model = bacon.create_model(data)
prob = model.create()
optim = SolverFactory('glpk')
result = optim.solve(prob, tee=True)
prob.load(result)
```

All the work happens in the functions defined within `bacon.py`.

Expand Down

0 comments on commit 6c29c4c

Please sign in to comment.