Skip to content

Error in "image" directive when using procedures  #10

Description

@andrewchou34

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions