MNT: pythonified the creation of the data list

Also:
 - rearranged port order on the input side
 - improved error handling based on user input
 - added minor in-line comments