Tuesday, 9 May 2017

Communication between node js and python - Send Complex data

Hello fellow programmers,

I am working on a Node.js project and I am trying to include some python (There is good reason why I have to include python). I don't know much about python and even less about how to use it with Node.js. Right now, I am trying to do send an array of Object to my python script and received back a blob (my python script creates files). I am wondering if someone has some experience can tell me what approach I should take. I saw stdout and stdin, should I use this or use something else?

I am currently using PythonShell but I don't know if there is better library for sending a complex.

Here is what my array looks like:

   var array= 
   {
       object: 
       [
          {
            x: 20,
            y: 43,
            hidden: false,
            data: 
            [
               {
                 'key' : 'Subject2', 
                 'value' :
                 [
                     {
                      'name' : 'C001', 
                      'age' : 41
                     },
                     {
                      'name' : 'C002', 
                      'age' : 37
                     }
                ]
              }

      ]
 }

*Note: The sending back a blob is not really important. I can manage without it.

Thank you for your time!



via TheOneWhoMightKnow

No comments:

Post a Comment