
python
秋媃嫣姬
好好做人
展开
-
往txt写入中文
1、要添加以下语句import sysreload(sys)sys.setdefaultencoding('utf-8)2、示例程序def main2(): dic = [] with codecs.open('***.txt', 'r', 'GBK') as f: lines = f.readlines() for line in lines: ...原创 2018-06-29 16:16:15 · 450 阅读 · 0 评论 -
python 写入excel
1、python写入excel需要import xlwtexcel = xlwt.Workbook(encoding = 'utf-8') # 创建一个Excel sheet = excel.add_sheet('Sheet1') # 在其中创建一个名为hello的sheet sheet.write(0, 0, u'企业名称') # 往sheet里第一行第一列写一个数据 sheet.writ...原创 2018-06-19 22:07:49 · 5797 阅读 · 0 评论 -
conda环境操作
1、新建环境 conda create -n "name" python=2.7 anaconda "name"指自定义虚环境名字 2、激活虚环境 source activate "name" 3、退出虚环境 source deactivate 4、删除虚环境 conda remove --name "name" -all...原创 2018-06-23 15:41:52 · 1019 阅读 · 0 评论