Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling python from fortran #19

Open
Pooja03011996 opened this issue Jun 18, 2022 · 1 comment
Open

calling python from fortran #19

Pooja03011996 opened this issue Jun 18, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Pooja03011996
Copy link

how we can use values of few variables into python. For example, in Fortran, I am running a calculation for calculation of few coordinates. That coordinate values I have to use in my python machine learning program. The value returned from python code is to be further used in Fortran program. So how can i do this using call_py_fort??

@nbren12
Copy link
Owner

nbren12 commented Jun 18, 2022

you can call set state/get state multiple times with different names to handle multiple inputs/outputs.

you can “return a python value to fortran” by setting it in the state dictionary passed to the python function with some key, and then use that key in “get_state” on the fortran side.

I should add an example for something like this.

@nbren12 nbren12 added the enhancement New feature or request label Jun 18, 2022
@nbren12 nbren12 self-assigned this Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants