updated python scripts to use socket when port is null