rework python mode