T
T
Timofey Bulgarian2019-01-20 15:15:10
Python
Timofey Bulgarian, 2019-01-20 15:15:10

How to pass values ​​from C# to Python?

There is a small game on the Unity engine (mine). You need to create a python script that will interact with this game. For example, read some data from it and control the game from a python script. For control, you can use emulation of keystrokes. But I did not understand how to read the values.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
Talyan, 2019-01-20
@flapflapjack

Python can press keys both programmatically and emulate hardware using the interception driver.
Here is the article: https://habr.com/ru/post/346258/ About the exchange of data between applications
- here https://habr.com/en/post/346258/
memory mapping
https://docs.microsoft.com/en-us/dotnet/standard/i...
You can still use sockets for example, but this is more suitable for network applications than for two processes on one PC.

A
Alexander Taratin, 2019-01-20
@Taraflex

https://grpc.io/

R
Roman, 2019-01-29
@evocatus

If the only OS in the world was Linux, then I would say: just use named FIFOs (man 7 pipes) (they are also available for Windows ) or file sockets (man 7 unix) ( there is some analogue for Windows ). You can even take ZeroMQ.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question