ESP8266 and Python Communication
Check my project: "Esp 2 Python"

https://github.com/KebabLord/esp_to_python

The theori is you can create a localhost and get the sensor data or manage the module through arduino requests or urllib modules with a simple local mDNS server. This project allows you to control and read ESP.