python的基础

一、安装时的一些错误:

Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

解决办法:pip install PyYAML --upgrade --ignore-installed PyYAML

二、python脚本支持中文:

# -*- coding: utf-8 -*-

在脚本开头加这个注解

三、python脚本的字符问题:

cat -A aai.py(查看全部的字符)

sed -i 's/\xc2\xa0/ /g' aai.py(空格键的替换)

sed -i 's/\r//g' aai.py(\r键的替换)

posted @ 2019-01-31 09:56  海平面下的我们  阅读(112)  评论(0编辑  收藏  举报