Topic: python module use
Is there any information or help on using some Python modules in Simply Fortran? Is it even possible?
For discussions of all Approximatrix products and related software
You are not logged in. Please login or register.
Approximatrix Forums → User Support → python module use
Is there any information or help on using some Python modules in Simply Fortran? Is it even possible?
It depends on what you mean by "using some Python modules." Are you asking about integrating Fortran with Python?
We have an inexpensive potentiostat that comes with a Python module software interface for control and data acquisition. I want to write an overall experiment control and data processing program with a GUI interface. I am much happier working in Simply Fortran than in Python - I could detail why if you'd like. My hope is that I can somehow "import" the Python module into a Fortran program - sending instructions and collecting data. Reference: The Rodeostat potentiostat manufactured by Iorodeo.
Thanks
Of course you can interface Python and Fortran, but the process isn't trivial. In your case, it sounds like you'd like to have a Fortran "primary" GUI program that is using the Python interface to the Rodeostat device. That situation might be tricky because, normally, people are working in the opposite direction (Python calling Fortran for speed reasons).
There appears to be a promising library call_py_fort that allows calling Python routines from Fortran. It might be tricky here too, though, because you really want to hold a Python object, in your case a Potentiostat object, in your Fortran program to pass back and forth. The object would be opaque to Fortran, but Python would be able to understand it.
Another library that might work better is ForPy that seems to be a bit less numerical-calculation-specific. It appears to handle passing opaque objects back to Fortran. However, it looks a bit less maintained.
Neither solution is particularly pleasant because you're attempting to interact with Python's interpreter from a compiled program. Some reading suggests (and I might lean this way too) simply running Fortran's EXECUTE_COMMAND_LINE to call Python scripts to do what you want. It's another alternative that avoids the possible nightmare of trying to interact with the Python shared libraries directly, but it would require quite a bit of Python programming as well to provide a command-line interface to everything you want to do.
Sorry if this wasn't the solution you were hoping for, but interfacing disparate languages is rarely simple.
Thanks for the help, it looks like the simple answer is Forget It.
Approximatrix Forums → User Support → python module use
Powered by PunBB, supported by Informer Technologies, Inc.