Python Based API

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dean.Brotzel@gmail.com

    #1

    Python Based API

    Hi,

    I work on a project that is built entirely using python and Tkinter.
    We are at the point where we would like to give access to our
    functionality to others via some sort of API. People who would use
    our API develop in all kinds of languages from C/C++ to Pascal.

    Ideas that come to mind that allow us to build such an API are:

    1) Require others to imbed the python interpreter via the c API to be
    able to utilize our functionality.
    2) Build an XML RPC interface around our code.
    3) Rewrite our code base in C/C++, which should make it accessible to
    all modern languages.

    I'm looking for more and potentially better ideas that will allow us
    to offer an API to our customers without having to throw away or redo
    a lot of the python code that we have already written.

    Thanks in advance,
    Dean

  • Laurent Pointal

    #2
    Re: Python Based API

    Dean.Brotzel@gm ail.com wrote:
    Hi,
    >
    I work on a project that is built entirely using python and Tkinter.
    We are at the point where we would like to give access to our
    functionality to others via some sort of API. People who would use
    our API develop in all kinds of languages from C/C++ to Pascal.
    >
    Ideas that come to mind that allow us to build such an API are:
    >
    1) Require others to imbed the python interpreter via the c API to be
    able to utilize our functionality.
    2) Build an XML RPC interface around our code.
    3) Rewrite our code base in C/C++, which should make it accessible to
    all modern languages.
    >
    I'm looking for more and potentially better ideas that will allow us
    to offer an API to our customers without having to throw away or redo
    a lot of the python code that we have already written.
    >
    Thanks in advance,
    Dean
    IMHO the simplest solution is XML RPC, and unless you have huge data to
    transmit or time constraint, it may be enough.


    Comment

    • Larry Bates

      #3
      Re: Python Based API

      Dean.Brotzel@gm ail.com wrote:
      Hi,
      >
      I work on a project that is built entirely using python and Tkinter.
      We are at the point where we would like to give access to our
      functionality to others via some sort of API. People who would use
      our API develop in all kinds of languages from C/C++ to Pascal.
      >
      Ideas that come to mind that allow us to build such an API are:
      >
      1) Require others to imbed the python interpreter via the c API to be
      able to utilize our functionality.
      2) Build an XML RPC interface around our code.
      3) Rewrite our code base in C/C++, which should make it accessible to
      all modern languages.
      >
      I'm looking for more and potentially better ideas that will allow us
      to offer an API to our customers without having to throw away or redo
      a lot of the python code that we have already written.
      >
      Thanks in advance,
      Dean
      >
      You don't say what your operating system is, so I'll give an answer in
      case it is Windows:

      I went through something similar recently and decided that writing a COM
      wrapper around my Python API was the best answer (and it turned out to
      be pretty easy). I was easily able to call from VB, Delphi and Python
      COM. I haven't tried C/C++ yet, but expect no problems. I think COM is
      now the way to go (unless you do .NET).

      -Larry

      Comment

      Working...