小陆同学

python 中文名:蟒蛇,设计者:Guido van Rossum

导航

2019年12月29日 #

python-对接钉钉,获取access_token

摘要: 1.首先注册应用,获取 appkey、appsecret api_url = "https://oapi.dingtalk.com/gettoken?appkey=%s&appsecret=%s"%(appkey,appsecret) def get_token(): # try: res = re 阅读全文

posted @ 2019-12-29 18:30 小陆同学 阅读(2862) 评论(0) 推荐(0) 编辑

django-数据库迁移-Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE

摘要: Django数据库迁移报错:1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='" 原因是在创建数据库时没有指定编码utf8 正确 阅读全文

posted @ 2019-12-29 18:21 小陆同学 阅读(2431) 评论(0) 推荐(0) 编辑

linux-安装npm、cnpm

摘要: 1.安装node wget https://nodejs.org/dist/v10.15.0/node-v10.15.0-linux-x64.tar.xz 2.解压 tar -xf node-v10.15.0-linux-x64.tar.xz 3.配置全局变量 # vim /etc/profile 阅读全文

posted @ 2019-12-29 18:15 小陆同学 阅读(4191) 评论(0) 推荐(0) 编辑

python-汉字转拼音

摘要: import pypinyin # 不带声调的(style=pypinyin.NORMAL) def pinyin(word): s = '' for i in pypinyin.pinyin(word, style=pypinyin.NORMAL): s += ''.join(i) return 阅读全文

posted @ 2019-12-29 18:08 小陆同学 阅读(1602) 评论(0) 推荐(0) 编辑

python-os模块拆分文件路径和文件名

摘要: import os file_path = "/var/www/project/logs/projectpom.log" (filepath,tempfilename) = os.path.split(file_path) (filename,extension) = os.path.splitex 阅读全文

posted @ 2019-12-29 18:06 小陆同学 阅读(5860) 评论(0) 推荐(0) 编辑