What you're trying to accomplish is called Odometry, and fortunately it's a pretty common task in robotics so there's a lot of information available on how to do it. The short answer is, it's relatively easy to implement, but hard to make it work really well.
Let's make things simpler by deciding that the robot can only a) drive straight and b) turn 90 ...
This isn't exactly sending direct commands to your robot, but LEGO Education recently released a python stack for the EV3 brick.
I haven't tried it; but as I understand it, it's an alternative firmware which should allow you to have python scripts running natively on your EV3 brick, allowing for full autonomous robots programmed in python.