Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import sys
import nose.tools as nt
from IPython.core import oinspect
def test_oinspect_f2py():
from numpy import f2py
# This is FORTRAN, so the indentation is important:
source = \
"""
SUBROUTINE HELLO_WORLD
c This routine does absolutely nothing!
END
"""
modulename = 'test_oinspect_f2py'
try:
f2py.compile(source, modulename=modulename)
__import__(modulename)
mod = sys.modules[modulename]
except:
# Compilation failed, perhaps because no FORTRAN compiler
# was available.
pass
else:
oinspect.find_file(mod.hello_world)
if __name__ == "__main__":
test_oinspect_f2py()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.