随笔分类 -  Python

关于Python相关知识的
Python 函数/高阶函数
摘要:编写高阶函数,就是让函数的参数能够接收别的函数。 阅读全文

posted @ 2019-08-04 12:49 思此狂 阅读(89) 评论(0) 推荐(0) 编辑

Python dic/set/迭代
摘要:字典的定义 dic = {"name":"zhangsan","age":7,"val":{"math":60,"eng":80}} 值的输出 print dic["name"] #zhangsan print dic["val"]["math"] #60 字典的遍历 dic = {"name":" 阅读全文

posted @ 2019-08-03 13:29 思此狂 阅读(301) 评论(0) 推荐(0) 编辑

python matplotlib 图标绘制
摘要:更多可以访问 https://www.runoob.com/numpy/numpy-matplotlib.html 阅读全文

posted @ 2019-07-21 16:02 思此狂 阅读(1058) 评论(0) 推荐(0) 编辑

python unittest
摘要:lib.py重的一个add函数 test.py中的测试函数 NameTestCase 是我们创建的类,用于包含一些列测试单元。类的名字可以随便命名,但最好有意义,与测试有关。 testadd 是我们的一个测试方法,运行测试文件时候,所有test开头的都会被 运行。 assertAlmostEqual 阅读全文

posted @ 2019-05-18 23:27 思此狂 阅读(157) 评论(0) 推荐(0) 编辑

python socket
摘要:服务端 客户端 阅读全文

posted @ 2018-02-24 00:30 思此狂 阅读(132) 评论(0) 推荐(0) 编辑

python-subprocess
摘要:【subprocess 模块】 subprocess 允许你生成新的子进程,连接到子进程的标准输入,输出,错误输出等,并获得它的返回值,这个模块后续会替换掉一些老的模块 os.systemos.spawn*os.popen*popen2.*commands.* subprocess.call():运 阅读全文

posted @ 2017-12-23 17:08 思此狂 阅读(225) 评论(0) 推荐(0) 编辑

python常见问题及解决
摘要:1 UnicodeEncodeError: 'ascii' codec can't encode characters 解决方法: 阅读全文

posted @ 2017-09-21 15:42 思此狂 阅读(136) 评论(0) 推荐(0) 编辑

python 代码脚本集
摘要:if / else 三目运算 真值判断 for / else break语句不执行时候就会执行 else语句 获取字典元素 文件内容的对比 符号含义的说明'-' 包含在第一个序列行中,但不包含在第二个序列行'+' 包含在第二个序列行中,但不包含在第一个序列行'' 两个序列行一致'?'标志两个序列行存 阅读全文

posted @ 2017-09-11 16:38 思此狂 阅读(455) 评论(0) 推荐(0) 编辑

python-mongodb
摘要:Mongodb - python drivers 模块 pymongo 阅读全文

posted @ 2017-09-11 16:08 思此狂 阅读(126) 评论(0) 推荐(0) 编辑

python常用模块
摘要:【os模块 】 当前路径下的所有目录 [x for x in os.listdir(".") if os.path.isdir(x)] 【json】 import json dic = {"name":"jinkang","age":23} d = json.dumps(dic) print typ 阅读全文

posted @ 2017-08-24 14:01 思此狂 阅读(233) 评论(0) 推荐(0) 编辑

python笔记
摘要:字符串的格式化 print "hello %s your age %d" %("zhangsan",18) print "hello %s your age" % "zhangsan" 参数一个时 可以不要括号 print "hello {0} your age {1}".format("zhang 阅读全文

posted @ 2017-08-21 01:14 思此狂 阅读(188) 评论(0) 推荐(0) 编辑

Flask
摘要:虚拟环境的配置 pip install virtualenv 创建一个虚拟环境,参数是虚拟环境的目标目录 virtualenv venv 激活虚拟环境 source venv/bin/activate 运行所需的依赖包 pip freeze > requirements.txt 1 开启调试模式,修 阅读全文

posted @ 2017-06-12 16:29 思此狂 阅读(177) 评论(0) 推荐(0) 编辑

python 学习笔记
摘要:类 和 实例 class Student(object): def __init__(self, name,score): super(Student, self).__init__() self.name = name self.score = score def get_grade(self): 阅读全文

posted @ 2017-06-03 13:40 思此狂 阅读(202) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示