Re: ways to comunicate between different application

2020-03-27 Thread yglukhov
Or just use [nimpy](https://github.com/yglukhov/nimpy) :)


Re: ways to comunicate between different application

2020-03-27 Thread enthus1ast
sure you can but then its not so simple to have an "eval loop"

socket1: 


--connection->
--do this->
<--ok-some info---
--do that->
<--ok-some info---


Run

socket2:


-connection->
<-update this--
ok>
<-update that--
ok>


Run

multiplexing different channels over one line is more complex and when he asks 
for "how to do interprocess communication" then i guess he wants it simple.


Re: ways to comunicate between different application

2020-03-27 Thread treeform
You only need one socket to communicate between python and nim. 


Re: ways to comunicate between different application

2020-03-27 Thread nais314
my guess is, using net on nim side, socket on python side (realpython.com).


Re: ways to comunicate between different application

2020-03-27 Thread enthus1ast
There are several ways,

if the python app is fired only once, then maybe command line params and stdout 
are enough for communication.

or both applications communicate with network sockets:


Socket one
nim -socket-> python
- python do this
- python do that


Run


socket2:
nim <-socket- python
- nim this was done
- nim update the gui please


Run

you could send line seperated json objects through the network socket, this 
would just require readLine() and parseJson() on both sides.

I've choosen two sockets for this proposal, because then socket1 can always 
send, and socket2 can always receive (or the other way around).

Please also remember that it does not make a difference who is initiating a tcp 
conneciton. So who is the "server" does not matter. It could be nim or python 
who is listening.

If you have more concrete questions, don't hesitate to ask.