python mode change