Two simple scripts that will easily serve as a basis to send and recieve data from Python to Unity.
They use socket connection to create a data stream between Unity and Python. Very useful if you want to use python scripts in a Unity project, or process videogame data in Python. Connection is very fast, so don't worry about that!
Just place your IP address and change the port (if you want to) in both files and they are ready to be used! To implement them in your project, just change the send and recieve functions to whatever you need. As of this files, these functions just print the values. It is important that the Python script is executing before starting the Unity project.