Skip to content

Instantly share code, notes, and snippets.

@bfroehle
Created June 12, 2012 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bfroehle/2920793 to your computer and use it in GitHub Desktop.
Save bfroehle/2920793 to your computer and use it in GitHub Desktop.
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