Write/Read variables of UR3 with a Python Script

Hi, there!
I’m developing a Python Script which through computer vision (OpenCV) and machine Learning (Tensorflow) is able to define the best possbile move that UR3 robot will make in a Tic-Tac-Toe game.
So, I need to comunicate with UR3 robot, through Socket TCP or ModBus to read and write global variables in real time. I read about RTDE and another ports that are used to robot communication but I don’t find any topic that contains an easily way of read/write variables with Python.
Example: a need a variable that stores the position where the robot will mark a “X” with a pen. How can I develop a Python code that writes an integer value in this variable into UR3.
Could you help me?

Hi @leonardo.leao,
you could share data using sockets:

Also using XMLRPC is a viable way.