A Pyblish Project for providing graphical front-end using NW.js, an app runtime based on Chromium and node.js
A Pyblish Project for providing graphical front-end using NW.js, an app runtime based on Chromium and node.js
Cool, I’ll get the conversation started.
I can see a number of benefits of a Node.js implementation of a frontend.
It’s not all glitter and sparkles however.
What other pros and cons can you think of?
@ljkart From our conversation on Hangouts, you were looking at communicating with Python through Node.js?
Pros:
Cons :
@marcus : experimenting inter-communication between node.js and python. would like to know best way for doing that.
like having a python server running and respond to NW and NW will render the output to GUI.
Will start doing through simple ways using http or sockets?
expecting more suggestions!
Those looks like some very good pros and cons of Webkit, but in a very general sense. How about in relation to Pyblish QML?
Here are the question I think we need to have a think about before getting too deep into development.
What will Pyblish NW offer…
like having a python server running and respond to NW and NW will render the output to GUI.
Here’s an example of how you can open up a connection to a running instance of Python.
Python
import flask
app = flask.Flask(__name__)
@app.route("/")
def main():
print "Triggered from Node.js!"
if __name__ == "__main__":
app.run(port=8000)
From here, you can send a request to Python from Node.js, like this.
Node.js
// Node.js
var http = require('http');
var options = {
host: '127.0.0.1',
port: '8000',
path: '/'
};
http.request(options, function (response) {
console.log(response);
}).end();
Running that in any Node.js console or app will make the Python console output something like:
Triggered from Node.js!
127.0.0.1 - - [06/May/2015 13:16:18] "GET / HTTP/1.1" 500 -
And from there, it’s up to you to handle the request and do something useful with it.