[Interest] Adding Scripting Capabilities to my Application (Suggestions on how to get started)

Jason H scorp1us at yahoo.com
Thu Mar 13 20:05:22 CET 2014


Check out SIP. It's nto automatic, but it is easy.


----- Original Message -----
From: Michael Jackson <imikejackson at gmail.com>
To: interest at qt-project.org
Cc: 
Sent: Thursday, March 13, 2014 1:14 PM
Subject: Re: [Interest] Adding Scripting Capabilities to my Application	(Suggestions on how to get started)

I am in the science community and Python seems to be used a bunch here. I guess I am looking at someone writing a python script that would load our libraries and be able to make calls to the library to perform the analysis that they want. I am even hoping for some sort of Automated Wrapping function much like projects such as VTK and ParaView have for wrapping all of their C++ code in Python.

I would consider Lua also but I think I would like to wrap with something that our users are already using.

Thanks for the pointers.

Mike Jackson


On Mar 12, 2014, at 2:57 PM, Jason H <scorp1us at yahoo.com> wrote:

> LUA is becoming very popular. And the libraries are comprehensive.
> 
> I however am a Python fan and to add a python interpreter to your program is very easy. You can also wield the enormity of python libraries.
> You don't need to do anything more than: code your functions in python, marshal your data into the interpreter with a variable name, then call the function in the interpreter with that variable to have the python do its thing. Then marshal your data back out.
> 
> It shouldn't require much in theory you could take your data, JSON it, store it as a python dict and have your function expect a dict as input. Getting results out is equally simple.
> 
> However if you need to marshal classes you can use SIP (riverbank computing) to provide a class wrapper for python to use.
> 
> If you do get confused by the Python Extending vs Embedding issue, they will recommend extending. For what you are doing, u only need/want embedding. 
> http://docs.python.org/2/extending/
> 
> 
> 
> 
> 
> 
> From: Michael Jackson <imikejackson at gmail.com>
> To: "<interest at qt-project.org>" <interest at qt-project.org> 
> Sent: Wednesday, March 12, 2014 2:06 PM
> Subject: [Interest] Adding Scripting Capabilities to my Application    (Suggestions on how to get started)
> 
> Hello Qt Community. 
>   I help develop a combination of library/application (dream3d.bluequartz.net) and we would like to add some scripting capabilities to it. I'll  state what I _think_ I want and hopefully get a sanity check as to whether it is really possible or not.
> 
> Our project as a main Application that is GUI based and is the user facing portion. It allows the user to setup a Pipeline of "filters" to be run on a set of data. We have separated the "View" parts from the "model" parts and so we can actually execute a pipeline from the command line by feeding it a special .ini file that describes the inputs for each filter in sequence. What I think we would like to add is the ability to write "script" file that allows more than just running the filters in sequence but would also add all the basic language features such as loops and conditionals. So I am envisioning someone writing something like a JavaScript file that would be executed. The script file would contain all the logic to drive a pipeline or multiple pipelines or variations on a pipeline or something like that. Basically, a way to hook together our filters but NOT have to do a full blown compile of the codes. I took a look at QML, QtScript and something
 else but I am really ju
s
> t getting confused at this point. It was suggested to wrap all of our classes in Python or Java or Ruby. I was really hoping to be able to utilize something built into Qt (Qt4 currently but we are working to move to Qt5) so that I didn't have to ensure the user has the proper scripting language installed on their systems (OS X, Linux & Windows).
> 
> So I would sincerely appreciate any suggestions or personal experiences from the Qt community about how to proceed or where to look for more examples. 
> 
> 
> Thanks
> --
> Mike Jackson
> http://dream3d.bluequartz.net   ::::::::::  http://www.github.com/dream3d/DREAM3D
> 
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
> 
> 

_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list