Set up python mode properly