Network control with python