0

I have two projects on hand, (A) written in Lua-5.1, (B) written in python3.6.

Currently I am using Websocket for data exchange bewteen A and B program. However, I cannot ensure the performance of using websocket since there are some network latency sometimes. Tried to use Protobuf, but network is still an issue.

Include Lua project in Python may solve this problem. Is there any way to do so? Like compile Lua project to a shared library (.so), and include it in my Python project?

appletabo
  • 239
  • 2
  • 12
  • Maybe see https://stackoverflow.com/questions/6234252/how-to-embed-lua-inside-python ? – AKX Aug 30 '18 at 10:48
  • https://github.com/bastibe/lunatic-python – Henri Menke Aug 30 '18 at 12:08
  • Are programs executed on the same pc? Apart from web sockets there are also pipes and files (mapped to memory). Or indeed you could use python-c interface to wrap c-lua interface. Here is good example of how lua script is executed with minimal c code: https://en.blog.nic.cz/2015/08/12/embedding-luajit-in-30-minutes-or-so/ There is half a dozen of methods of interfacing python with c, google may or may not find a decent overview of those. – Dimitry Aug 30 '18 at 12:45

0 Answers0