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

Jason H scorp1us at yahoo.com
Wed Mar 12 19:57:22 CET 2014


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 jus
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140312/fca32619/attachment.html>


More information about the Interest mailing list