python modem manipulating module