Python interface to FlexLib API

  • 3
  • Idea
  • Updated 5 years ago
Is anyone aware of / working on a Python interface to the FlexLib API? This would be quite useful. I'm a competent Python programmer, but haven't dabbled in .NET.
Photo of Mark Erbaugh

Mark Erbaugh

  • 510 Posts
  • 43 Reply Likes

Posted 5 years ago

  • 3
Photo of Larry da Ponte

Larry da Ponte

  • 159 Posts
  • 15 Reply Likes
The Flex libraries should be compatible with IronPython.
Photo of Bill - K7UOP

Bill - K7UOP

  • 34 Posts
  • 6 Reply Likes

I remember when I was working with Python on the Raspberry Pi (uses a variation of Debian Linux) that .NET libraries are available. Don't know how extensive they are but would be worth looking into (maybe you already have (?).

Python compatibility might open up some apps on those smaller platforms.

Photo of Mark Erbaugh

Mark Erbaugh

  • 510 Posts
  • 43 Reply Likes
I've not worked with .net, but I found a ,net add-on for Python. The examples showed how to interact with Office. I'm guessing it wouldn't be that hard to use the Flexlib API. I assume that the C++ code would have to be compiled into a DLL, or is that DLL already part of SmartSDR?

I've not worked with Iron Python, but that's another option. The thing about standard Python is that there are so many add on libraries and some aren't fully compatible with Iron Python.

Martin Ewing published a Python based for the Beable Bone in a recent QST. It would be nice to be able to integrate that with Flexlib.
Photo of Mark Erbaugh

Mark Erbaugh

  • 510 Posts
  • 43 Reply Likes
Another thought: would it make more sense for The Python library totalk directly to the Flex using. Python TCP/UDP library?
Photo of James Whiteway

James Whiteway

  • 1049 Posts
  • 300 Reply Likes
The Flexlib api is written in C#. When I downloaded it, I had to recompile it to use the dll's.
Once I did that, all was well. Other than I'm still, trying to actually connect to my 6300 and
have not quite succeeded yet!!! :-)
But, then again, I'm not a C# guru and have been attempting to do it in VB.Net. Such fun!
james
WD5GWY
 
Photo of Mark Erbaugh

Mark Erbaugh

  • 510 Posts
  • 43 Reply Likes
Update: I was able to access the FlexLib API .DLLs from C Python 2.7.9 using PythonDotNet at https://github.com/geographika/PythonDotNet. The problem with original Python for .NET at http://pythonnet.sourceforge.net/ is that it seems to be only form 32-bit versions.

I used the version for WIndow2012 and it works with Windows 7. One gotcha that took me a while to figure out was that for the clr.pyt and PythonRuntime.dll files, you need to open the file properties and click "UNBLOCK" for .NET to allow them, since they were downloaded.

I just put the clr.pyt, PythonRuntime.dll and the FlexLib API DLLs the DLLs folder of my Python installation.