小陆同学

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

导航

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 23 下一页

2020年1月17日 #

python--终端工具之subprocess

摘要: 一、 subprocess.getstatusoutput import subprocess cmd = 'ifconfig' def cmds(cmd,print_msg=True): status,result = subprocess.getstatusoutput(cmd) if stat 阅读全文

posted @ 2020-01-17 22:52 小陆同学 阅读(463) 评论(0) 推荐(0) 编辑

jquery-触底加载无限滚动

摘要: 在我们将较长的执行结果展示到前端页面时可能会较占篇幅,可以设置一个无限滚动效果将其固定显示在一个固定大小的框框,并且执行结果实现实时更新 HTML代码: <div id="post_deploy_result" name="deploy_result" style="height: 150px;ov 阅读全文

posted @ 2020-01-17 22:32 小陆同学 阅读(1179) 评论(0) 推荐(0) 编辑

python-比较字典value的最大值

摘要: 假设定义一字典,m = {"a":3,"e":6,"b":2,"g":7,"f":7,"c":1,"d":5},在不知道key的情况下如何找出字典中value最大的所有key-value对?下面讨论几种方法。 1)通过m.values()和max()函数 第一步,通过max()函数找到字典中的val 阅读全文

posted @ 2020-01-17 22:04 小陆同学 阅读(10047) 评论(0) 推荐(1) 编辑

Linux-查看cpu核数和个数、查看内存的命令

摘要: cat /proc/cpuinfo | grep 'physical id' | sort | uniq | wc -l 个数 cat /proc/cpuinfo | grep 'process' | sort | uniq | wc -l 核数 cat /proc/meminfo 查看内存 阅读全文

posted @ 2020-01-17 22:00 小陆同学 阅读(3207) 评论(1) 推荐(0) 编辑

python读取本地正在运行的docker容器

摘要: import docker client = docker.from_env() docker_ps_list = client.containers() length = len(docker_ps_list) print(length) for container in docker_ps_li 阅读全文

posted @ 2020-01-17 21:58 小陆同学 阅读(1630) 评论(0) 推荐(0) 编辑

django-mysql报错

摘要: 在执行python3 manage.py migrate时报错:操作错误,某库未给某用户授权 django.db.utils.OperationalError: (1044, "Access denied for user 'xxx'@'localhost' to database 'xxx'") 阅读全文

posted @ 2020-01-17 21:54 小陆同学 阅读(307) 评论(0) 推荐(0) 编辑

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) 编辑

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 23 下一页