matplotlib & mod_python

K

kenneth

Hi all.

I would like to use a "combination" of matplotlib and mod_python to
create a
PNG figure on the fly in my web site.
The mod_python handler code should be something like this:


def handler(req):

fig = Figure()
...
... figure creation stuff
...
canvas = FigureCanvasAgg(fig)
canvas.print_figure(req, dpi=72)

return apache.OK


This code gives me an error as req is not a file-like instance (as
sys.stdout):

TyperError: Could not convert object to file pointer

Is there a way to to this thing ?

Thank you very much for any suggestion,
Paolo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top