随笔分类 -  Coding-Python

Data analysis
摘要:目标:一个 REST API,如何写异常,让client端使用的舒舒服服。 先来个热身 一、异常处理 Ref: Flask Rest API -Part:4- Exception Handling 需要单独写一个这样的文件:errors.py #~/movie-bag/resources/error 阅读全文
posted @ 2020-11-22 16:22 郝壹贰叁 阅读(84) 评论(0) 推荐(0) 编辑
摘要:Ref: https://testdriven.io/courses/tdd-django/django-rest-framework/ DRF is composed of two core components: Serializers are used to convert Django mo 阅读全文
posted @ 2020-11-14 18:02 郝壹贰叁 阅读(112) 评论(0) 推荐(0) 编辑
摘要:Let's go: https://testdriven.io/courses/tdd-django/ Ref: Django drf 教程【中文教程】 Ref: Django Rest-framework【十四罗汉】 Ref: https://www.django-rest-framework.o 阅读全文
posted @ 2020-11-13 14:47 郝壹贰叁 阅读(135) 评论(0) 推荐(0) 编辑
摘要:资源 MVT (MVC) 十借课,每节一个小时。 01 Django框架简介与环境搭建【先把 django-admin的命令装好】 每节比较短。 6节课入门Django框架web开发 有多用讲解的课程,较好。 Django Tutorials 一、创建项目 先安装虚拟环境。 1. 环境变量设置 ./ 阅读全文
posted @ 2020-11-06 19:57 郝壹贰叁 阅读(85) 评论(0) 推荐(0) 编辑
摘要:一些常见的问题: From: 吐血总结!50道Python面试题集锦(附答案) Q5、什么是PEP? PEP代表Python Enhancement Proposal。它是一组规则,指定如何格式化Python代码以获得最大可读性。 Q6、如何在Python中管理内存? python中的内存管理由Py 阅读全文
posted @ 2020-10-29 12:49 郝壹贰叁 阅读(69) 评论(0) 推荐(0) 编辑
摘要:Ref: https://testdriven.io/courses/tdd-flask/pytest-setup/ If this is your first time with pytest be sure to review the Installation and Getting Start 阅读全文
posted @ 2020-10-22 18:51 郝壹贰叁 阅读(110) 评论(0) 推荐(0) 编辑
摘要:前言 对于一门编程语言,没接触到“优化”和“库代码”的源码理解程度,不足以谈“掌握”二字。 本篇的学习笔记,同时也意味着自己终于触及到了Python的junior国际水准。(joke) 要学的东西有很多,尤其是年纪大了后对编程语言要有一个“体系”:[Code] 大蛇之数据工程,方便自己复习。 编程语 阅读全文
posted @ 2019-09-25 10:10 郝壹贰叁 阅读(356) 评论(0) 推荐(0) 编辑
摘要:Ref: Python 风格指南 - 内容目录 这里主要记录一下值得注意的地方。 Python语言规范 Lint vsCode自带 导入 完整路径 异常 Ref: [Python] 07 - Statements --> Functions 首先,自定义异常,基于“异常基类” class Error 阅读全文
posted @ 2019-08-22 22:41 郝壹贰叁 阅读(178) 评论(0) 推荐(0) 编辑
摘要:高性能编程 几个核心问题 • 生成器是怎样节约内存的?• 使用生成器的最佳时机是什么?• 我如何使用 itertools 来创建复杂的生成器工作流?• 延迟估值何时有益,何时无益? From: https://www.dataquest.io/blog/python-generators-tutor 阅读全文
posted @ 2019-08-22 22:34 郝壹贰叁 阅读(211) 评论(0) 推荐(0) 编辑
摘要:元类 Ref: 使用元类 动态创建一个类 动态创建一个类 by type() type()函数既可以返回一个对象的类型,又可以创建出新的类型。所以,不仅可以动态创建一个“对象”,也可以创建一个“类”。 比如,我们可以通过type()函数创建出Hello类,而无需通过class Hello(objec 阅读全文
posted @ 2019-08-19 18:01 郝壹贰叁 阅读(340) 评论(0) 推荐(0) 编辑
摘要:Ref: HOWTO Fetch Internet Resources Using The urllib Package Ref: Python High Performance - Second Edition【基于python3】 Ref: http://online.fliphtml5.com 阅读全文
posted @ 2018-10-22 13:09 郝壹贰叁 阅读(356) 评论(0) 推荐(0) 编辑
摘要:导入 C++,若干话题: Python调用 .so 传参类型转化表 图片的传入传出 python调用C++中的类 Call C++ 调用动态库 .so From: Python调用Linux下的动态库(.so) (1) 生成.so:.c to .so lolo@-id:workme$ gcc -Wa 阅读全文
posted @ 2018-06-19 18:07 郝壹贰叁 阅读(229) 评论(0) 推荐(0) 编辑
摘要:Exception 一、常见系统异常 Ref: The definitive guide to Python exceptions 更多内容详见:Python标准异常列表 except OSError 系统错误 except IOError IO错误 except ValueError 值错误:数字 阅读全文
posted @ 2018-06-14 20:53 郝壹贰叁 阅读(244) 评论(0) 推荐(0) 编辑
摘要:前言 资源 Ref: Python3 多线程 Ref: Python3之多进程 # python中的多线程无法利用多核优势 更多的提高效率的策略,请参见:[Pandas] 01 - A guy based on NumPy 多线程 一、认识线程 与进程的区别 线程在执行过程中与进程还是有区别的。 1 阅读全文
posted @ 2018-03-28 09:49 郝壹贰叁 阅读(591) 评论(0) 推荐(0) 编辑
摘要:故事背景 一、阶级关系 1. Programs are composed of modules.2. Modules contain statements.3. Statements contain expressions.4. Expressions create and process obje 阅读全文
posted @ 2018-02-04 14:53 郝壹贰叁 阅读(363) 评论(0) 推荐(0) 编辑
摘要:故事背景 阶级关系 1. Programs are composed of modules.2. Modules contain statements.3. Statements contain expressions.4. Expressions create and process object 阅读全文
posted @ 2018-01-23 09:12 郝壹贰叁 阅读(329) 评论(0) 推荐(0) 编辑
摘要:故事背景 阶级关系 1. Programs are composed of modules.2. Modules contain statements.3. Statements contain expressions.4. Expressions create and process object 阅读全文
posted @ 2018-01-22 20:35 郝壹贰叁 阅读(405) 评论(0) 推荐(0) 编辑
摘要:Introduction 本篇比较实用,有必要仔细整理。 若干个相关的库:scipy,scikit-learning,pandas,matplotlib 读大数据文件 # 样例模板 beer_data = "recipeData.csv" lines = (line for line in open 阅读全文
posted @ 2018-01-22 19:28 郝壹贰叁 阅读(658) 评论(0) 推荐(0) 编辑
摘要:相当实用的一些 “操作系统API”: Ref: https://docs.python.org/3/library/os.html 基础知识 一、程序初始化 获取参数 提取参数 异常检测 如果参数有误:logging.error(...) 不能继续执行,return ERROR_NUMBER 如果文 阅读全文
posted @ 2018-01-20 21:37 郝壹贰叁 阅读(256) 评论(0) 推荐(0) 编辑
摘要:List 列表 一、基础知识 基础功能 初始化方法 特例:初始化字符串 >>> sList = list("hello") >>> sList ['h', 'e', 'l', 'l', 'o'] 功能函数 append # 添加一个元素 pop # 拿走一个元素 sort reverse In [1 阅读全文
posted @ 2018-01-20 21:35 郝壹贰叁 阅读(277) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示