[py] improve code style of midiconv.py