update python code, move hardcoded ip and port to config'