pyreport icon indicating copy to clipboard operation
pyreport copied to clipboard

Error in "image" directive when using procedures

Open andrewchou34 opened this issue 11 years ago • 0 comments

When I run the snippet, I get the following error. Calling a print statement after pylab.show seems to cause an issue. I would appreciate any workarounds. Thanks!

#!/usr/bin/env python
from pylab import *

def foo1():
    print "hello"
    figure()
    plot([1,2,3])
    show()

def foo2():
    print "hello2"
    figure()
    plot([2,3,4])
    show()

def bar():
    foo1()
    foo2()

bar()
andrewchou:rnd andrewchou$ pyenv/bin/pyreport -t html src-scripts/factor-mom/test.py
Running python script /Users/andrewchou/dev/rnd/src-scripts/factor-mom/test.py:

hello
Here goes figure test_pyreport_0.png
hello2
Here goes figure test_pyreport_1.png

Outputing report to /Users/andrewchou/dev/rnd/src-scripts/factor-mom/test.html
<string>:50: (ERROR/3) Error in "image" directive:
no content permitted.

.. image:: test_pyreport_0.png

    hello2


Ran script in 0.46s

andrewchou34 avatar Aug 13 '14 16:08 andrewchou34