game coder
game coder

Reputation: 129

sending data from python to c#

I have a chart pattern recognition program using neural networks written in python .instead of porting the whole code to C# ,I decided it was better to only send certain bits indicating the following :

Buy=1,Sell=-1,Do nothing=0

once they are in C-sharp ,I could relay them to a third party program (multicharts) which would continuously call the C# dll function and receive these values after a certain time interval .

my question is ,is there a way to relay these bit's to C# and pack all of this in a dll ,which gets read by the 3rd party program ?

the whole reason I want to port to C# is because multicharts only reads in dll's and I don't think python has them.

sorry for being naive, I don't have very good grip on C#.

Upvotes: 0

Views: 899

Answers (1)

Sean Mitchell
Sean Mitchell

Reputation: 457

Your options are as follow,

Use a TCP socket, bind it to a port and listen for data in C# while the python application sends all data to it. C# has some great features for sockets such as System.Net.TcpClient and System.Net.TcpServer.

Your other option is that if the C# application only needs to be run once it receives information from the python program and then it can die, you could have the python program start the C# one and pass it parameters containing the information that you need transmitted.

By the looks of it your question only asked if there was a way to communicate, these are probably the best two. Please let me know if I can help anymore.

Upvotes: 1

Related Questions