python gateway