Could I use Qpyton as a library to interpreter a necessary python subroutine? - qpython

I have an APP which needs a python lib to support.
So I would like to retrieve qpython in order to execute python.
Is there anyone has tried to do it before?
I am finding a way to retrieve the part of Qpython to serve my purpose, instead of execute on its ternimal; and, finally get the execution result back to my APP.
Thanks~

Yes, you could call the QPython's OPEN API,
http://www.qpython.org/en/guide_extend.html

Related

Trigger selenium project without human intervention

I have completed automation script of my project. Now client wants to run selenium test case using URL or API. Client is not interested in Jenkins as well since they should need access for my project.
Overall client wants to trigger selenium without human intervention.
Any other idea than above is also welcome.
Thanks in Advance!!
You can provide command line or batch file depends on TestFramework(TestNg, Nunit, MsTest).
For e.g. You can use Mstest/TestContainer:Dll_Name ......some more parameters.
For TestNg, You can use Java "Jar file path" org.testing.TestNG testconfig.xml
Here i am just giving hints to you. Correct way to do it will depend on test framework used.

Node.js server interface with GUI application in Qt

I have created a Webserver architecture in Node.js. I need to create a bridge between this server and an already programmed Qt application.
Did you try:
https://github.com/node-ffi/node-ffi
It looks like the stuff that would help you. No need to modify the original sources, just load a shared object, define your functions and you are ready to go. It is similar to python ctypes, which works great for me when I need to call C code from python
The solution which worked really well for me is using QProcess
I have started ther server in Qt using QProcess. Here is the code
QString program ="/usr/bin/node";
QStringList arguments ;
arguments << "/home/phyvm/Try-8/v7/server.js";
myProcess = new QProcess(this);
myProcess->start(program, arguments);
Hope it helps:)
U can exec any binary using node.js but i'm not sure what you want to do.

How to use shp2pgsql

My question should be very simple to answer for anyone not being a self-taught newbie like me...
On this page is a cheatsheet concerning a function to be used in GIS/DB environnement : http://www.bostongis.com/pgsql2shp_shp2pgsql_quickguide.bqg
I would like to create a script allowing users to just have to click on it to launch the process, given the proper datas. But I don't understand how to use this. It obviously doesn't work in a Python console, nor directly in the windows console. How is it supposed to work ? What language is this ?
Thanks
shp2pgsql is indeed a command line tool. It comes with your PostgreSQL/PostGIS installation (usually) and, if not accessible via PATH-variable, can (usually) be run from within the /bin-folder in your PostgreSQL-Installation. You can also always 'make' the programm from source in any location yourself, if needed.
EDIT:
One way to set up a script (independent of whether you use it within qgis own python environment or not) would be to use Pythons subprocess (or os.system) module (check related question here) to write to shell and execute shp2pgsql.
A slightly more sophisitcated solution to (batch) insert (multiple) shapefiles via script could be to implement ogr2ogr via gdal/ogr module within python (check this blog). That, however, would require a working installation of the gdal core library, and the respective Python bindings (at least to use outside of QGIS Python environment, where it is pre-installed AFAIK), which can be tiresome at times. Once installed correctly, it offers a powerful (I dare say almighty) toolset for geodata management and manipulation via Python, though.
Apart from that, the blog link I provided also states the implementation of a batch insert script/tool (which operates ogr2ogr) in qgis 2.8 toolbox...maybe that can help you, either with your work directly or (via sourcecode) to point you in the direction of creating your own tool.

How to run matlab script on server? or Is there an online matlab interpreter?

I have a matlab script Temp_script.m (say) which,I want to execute on remote
server.
The server(remote) that I am using is free online hosting which gives me 1.5GB storage.
Since the server is remote one, I have no access to it, to install matlab software or runtime environment.
locally I can run the matlab script on my server.Obviously because I have matlab installed on my system.
My question "Is there a method to run the script online.? or Is there
any online interpreter for matlab?"
Thanking in advance
-Ryaan Dias
You can compile your project using deploytool.
This will give you several options, you can make a dll and probably even an exe.
However, the program is not going to run itself, so if you want it to run automatically on the server you need to have a framework there. Example could be .net but i guess there are easier ones.
AFAIK there isn't a web interface for Matlab, and I doubt that the Matlab license would cover such a use case. However, there you could always try to use the open-source equivalent Octave . Octave can execute Matlab code with only minor modifications.
A quick google search for Octave Web Server yielded many results. This was the first hit:http://knn.mimuw.edu.pl/weboctave-project/

Converting existing C library to have web interface

We have an existing C library (DLL / .so) that processes some data. There's a call to initialise it, then a call to give it the parameters it needs to process, and then a few calls to retrieve the different output parameters you are interested in. The initialise is then called to reset the library for the next session. We have an app built around this to easily input the data and view the results.
Now we want to take this library and make it available as a web service. We are looking for the simplest (read quickest) way to do this. As I see it, we need:
A web services framework (Apache Axis2/C looks good for existing C code)
Some way to start a process for each incoming query (not sure if Axis2 can do something like this).
So my question is : Is Axis2/C the simplest way, or is there another simple solution?
If you have an external executable you can call, how about using something like Apache with FastCGI?

Resources