Here's something on connecting to Python. This was written with the UNO-R4 in mind, but if you swap the WiFi library out it should work just about the same on just about any board. I've certainly used this exact same code on ESP8266 boards to connect to other code on my PC many many times.
The second post uses tk to create a window instead of trying to run a gui in the console. It's a lot easier to use.