Python API

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • RE: Python API

    I note that the latest release of Palo includes a .NET API. There is a Microsoft-supported version of Python for .NET, IronPytho, currently under development - see microsoft.com/downloads/detail…c6dacf3ae8&displaylang=en
    This mentions: "IronPython is the codename for a beta release of the Python programming language for the .NET platform. It supports an interactive interpreter with fully dynamic compilation. It is well integrated with the rest of the framework and makes all .NET libraries easily available to Python programmers. IronPython 1.0 Beta 2 is now available. Download it here."
    Does this mean that IronPython can be used together with your .NET API to access Palo? Thanks in advance for any views or comments.
  • RE: Python API

    There is not only Ironpython, but also Python for .Net that lets you use .Net ressources in usual python scripts.
    see zope.org/Members/Brian/PythonNet/README.html
    I am just, at the time beeing, converting a php script I wrote yesterday to load a cube (it worked well for 10 minutes but alas did not ended well but led to an apache abort) into a python script, using that Python for .Net (just two files to add to your python catalog) ; The results still are not still exactly what I want :) , but it works!! (less simple than PHP though).
    I someone is interested and if I can contrive to make it do something nearer to what I wish I can give it as an example for a beginning (at least of some python script that does something with a palo database).
    LJ
  • RE: Python API

    Originally posted by JAOUAN
    There is not only Ironpython, but also Python for .Net that lets you use .Net ressources in usual python scripts.
    see zope.org/Members/Brian/PythonNet/README.html
    I am just, at the time beeing, converting a php script I wrote yesterday to load a cube (it worked well for 10 minutes but alas did not ended well but led to an apache abort) into a python script, using that Python for .Net (just two files to add to your python catalog) ; The results still are not still exactly what I want :) , but it works!! (less simple than PHP though).
    I someone is interested and if I can contrive to make it do something nearer to what I wish I can give it as an example for a beginning (at least of some python script that does something with a palo database).


    I would be interesed in the Python script that you are developing to access Palo. Perhaps you could post it to the forum when you are ready or email to me at ofnap@nus.edu.sg.
  • RE: Python API

    You can also use JYTHON and the JAVA API which has been delivered at last.. by Tensegrity; I have just written a simple program to load a cube in this way and it seems to work well, even if I must test longer, using a larger part of this API. I have been using JYTHON for three years now(with the JAVA ORACLE DRIVER, JEXCEL, java SQLITE API, etc..) and I like it this way (Java packages are often good, but I do not like the java syntax very much..).
    LJ
  • RE: Python API

    Hello,

    Just a tip to help use the .NET API from PYTHON with Python for .NET. The GetData method can return a string or a double value and so do not give you the result as the return value but by modifying the first (string) or second (double) argument of the GetData method.

    Let us say you do in your python script :

    res=conn.GetData(sr, dr, DATABASE_NAME,CUBE_NAME, COORDINATES)

    see the API help:

    public void GetData(
    ref string str_result,
    ref double dbl_result,
    string database,
    string cube,
    string[] coordinates
    );

    If it is a decimal value that you try getting, you will get it as res[2], and if it is a string value, you will get it as res[1]

    The first None element (res[0]) is the 'void' return value; the others are the ref or out arguments.

    Brian Lloyd, the Python for .Net author , as confirmed this behaviour to me (I could not get the good value from sr or dr directly).
    LJ