mgao6767 / fortran-python-extension-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fortran Python extension example

This is a minimal working example for using Fortran to write Python extension.

src\fortext\algo\math.f90 contains a Fortran subroutine factorial.

We are to compile math.f90 into an extension fortext.algo.math.

pip install .

Then, we can use math.factorial() as:

from fortext.algo import math

print(math.factorial(5))

Build Status

This example is built and tested with Python 3.8 to 3.11, on Ubuntu, Windows and MacOS.

OS Status
Ubuntu Ubuntu
Windows Windows
MacOS MacOS

About

License:MIT License


Languages

Language:Python 70.9%Language:Fortran 29.1%