I have used MicroPython (mentioned by @westfw ) on an ESP32
e.g. a UDP server
import socket
UDP_IP = "192.168.1.68"
UDP_PORT = 10000
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP
sock.bind((UDP_IP, UDP_PORT))
while True:
data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes
print("received message: %s" % data)
it is also possible to transmit Serial data from a Python program on a pC to an Arduino running C++ or MicroPython code, e.g. have a look at transfering-float-data-between-pc-and-teensy
what do you wish to do? e.g. send data from PC to Arduino r Arduino to PC?