文章分类 -  python

上一页 1 2 3 4 5 下一页
An Introduction to Unit Testing in Python
摘要:https://www.freecodecamp.org/news/an-introduction-to-testing-in-python/ You just finished writing a piece of code and you are wondering what to do. Wi 阅读全文
posted @ 2022-01-25 19:39 guolongnv 阅读(33) 评论(0) 推荐(0)
unittest — Unit testing framework
摘要:https://docs.python.org/3/library/unittest.html Source code: Lib/unittest/__init__.py (If you are already familiar with the basic concepts of testing, 阅读全文
posted @ 2022-01-25 19:22 guolongnv 阅读(66) 评论(0) 推荐(0)
Python 中的 if __name__ == __main__
摘要:https://chinese.freecodecamp.org/news/if-name-main-python-example/ 当 Python 解释器读取一个 Python 文件时,它首先设置一些特殊变量,然后执行文件中的代码。 其中一个变量叫作 __name__。 如果你一步步地阅读本文, 阅读全文
posted @ 2022-01-25 19:07 guolongnv 阅读(67) 评论(0) 推荐(0)
Python classmethod 修饰符
摘要:https://www.runoob.com/python/python-func-classmethod.html 描述 classmethod 修饰符对应的函数不需要实例化,不需要 self 参数,但第一个参数需要是表示自身类的 cls 参数,可以来调用类的属性,类的方法,实例化对象等。 语法 阅读全文
posted @ 2022-01-25 18:36 guolongnv 阅读(26) 评论(0) 推荐(0)
python单元测试 unittest
摘要:https://www.liaoxuefeng.com/wiki/1016959663602400/1017604210683936 如果你听说过“测试驱动开发”(TDD:Test-Driven Development),单元测试就不陌生。 单元测试是用来对一个模块、一个函数或者一个类来进行正确性检 阅读全文
posted @ 2022-01-24 18:24 guolongnv 阅读(259) 评论(0) 推荐(0)
Python setattr() 函数
摘要:https://www.runoob.com/python/python-func-setattr.html 描述 setattr() 函数对应函数 getattr(),用于设置属性值,该属性不一定是存在的。 语法 setattr() 语法: setattr(object, name, value) 阅读全文
posted @ 2022-01-21 20:50 guolongnv 阅读(110) 评论(0) 推荐(0)
Python dir() 函数
摘要:https://www.runoob.com/python/python-func-dir.html 描述 dir() 函数不带参数时,返回当前范围内的变量、方法和定义的类型列表;带参数时,返回参数的属性、方法列表。如果参数包含方法__dir__(),该方法将被调用。如果参数不包含__dir__() 阅读全文
posted @ 2022-01-21 20:48 guolongnv 阅读(91) 评论(0) 推荐(0)
Python中的getattr()和__getattr__方法
摘要:原文链接:https://blog.csdn.net/wangyiyan315/article/details/14229981 getattr()先在python解释器看下getattr()的帮助 :Help on built-in function getattr in module __bui 阅读全文
posted @ 2022-01-21 20:45 guolongnv 阅读(572) 评论(0) 推荐(0)
Python getattr() 函数
摘要:https://www.runoob.com/python/python-func-getattr.html 描述 getattr() 函数用于返回一个对象属性值。 语法 getattr 语法: getattr(object, name[, default]) 参数 object -- 对象。 na 阅读全文
posted @ 2022-01-21 20:32 guolongnv 阅读(73) 评论(0) 推荐(0)
Python super() 函数
摘要:https://www.runoob.com/python/python-func-super.html 描述 super() 函数是用于调用父类(超类)的一个方法。 super() 是用来解决多重继承问题的,直接用类名调用父类方法在使用单继承的时候没问题,但是如果使用多继承,会涉及到查找顺序(MR 阅读全文
posted @ 2022-01-21 19:34 guolongnv 阅读(58) 评论(0) 推荐(0)
编写高质量代码改善 Python 程序的 91 个建议
摘要:https://l1nwatch.gitbook.io/writing_solid_python_code_gitbook/ 第1章 引论 1建议1:理解Pythonic概念 1建议2:编写Pythonic代码 5建议3:理解Python与C语言的不同之处 8建议4:在代码中适当添加注释 10建议5 阅读全文
posted @ 2022-01-21 18:25 guolongnv 阅读(232) 评论(0) 推荐(0)
python设定时间间隔和时间范围执行任务: Python任务调度模块APScheduler
摘要:https://segmentfault.com/a/1190000011084828 介绍 官网文档:http://apscheduler.readthedoc...API:http://apscheduler.readthedoc... APScheduler是一个python的第三方库,用来提 阅读全文
posted @ 2022-01-19 16:33 guolongnv 阅读(1579) 评论(0) 推荐(0)
作为一个Pythoner,不会SQLAlchemy都不好意思跟同行打招呼!
摘要:https://zhuanlan.zhihu.com/p/23190728 SQLAlchemy 是Python下的一款数据库对象关系映射(ORM)工具,能满足大多数数据库操作需求,同时支持多种数据库引擎(SQLite,MySQL,Postgresql,Oracle等)。所谓ORM(Object R 阅读全文
posted @ 2022-01-06 11:28 guolongnv 阅读(46) 评论(0) 推荐(0)
SQLAlchemy
摘要:https://github.com/sqlalchemy/sqlalchemy Introduction SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application develop 阅读全文
posted @ 2022-01-05 17:09 guolongnv 阅读(23) 评论(0) 推荐(0)
Python itertools accumulate函数详解
摘要:https://blog.csdn.net/CSerwangjun/article/details/102540663 一.定义itertools.accumulate(iterable[, func]) 二.解析iterable是一个可迭代的对象,如list等。 accumulate函数的功能是对 阅读全文
posted @ 2021-07-31 10:25 guolongnv 阅读(476) 评论(0) 推荐(0)
Python数据结构--链表
摘要:https://zhuanlan.zhihu.com/p/91399559 链表是什么 链表、列表,说起来有点相似,作用也有点类似,但可别傻傻分不清楚。我们一般说的列表,是一个连续的序列,用来存储一组数据。而链表,虽然也是有序的存储结构,但它不限定要“连续”的。 打个比方:列表就好像火车,每一节车厢 阅读全文
posted @ 2021-07-18 21:49 guolongnv 阅读(220) 评论(0) 推荐(0)
Python enumerate() 函数
摘要:https://www.runoob.com/python/python-func-enumerate.html 描述 enumerate() 函数用于将一个可遍历的数据对象(如列表、元组或字符串)组合为一个索引序列,同时列出数据和数据下标,一般用在 for 循环当中。 Python 2.3. 以上 阅读全文
posted @ 2021-07-17 23:24 guolongnv 阅读(249) 评论(0) 推荐(0)
Python JSON
摘要:https://www.runoob.com/python/python-json.html 本章节我们将为大家介绍如何使用 Python 语言来编码和解码 JSON 对象。 JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式,易于人阅读和编写。 JSON 阅读全文
posted @ 2021-07-06 14:24 guolongnv 阅读(23) 评论(0) 推荐(0)
Python classmethod 修饰符
摘要:https://www.runoob.com/python/python-func-classmethod.html 描述 classmethod 修饰符对应的函数不需要实例化,不需要 self 参数,但第一个参数需要是表示自身类的 cls 参数,可以来调用类的属性,类的方法,实例化对象等。 语法 阅读全文
posted @ 2021-07-02 19:35 guolongnv 阅读(30) 评论(0) 推荐(0)
Meaning of @classmethod and @staticmethod for beginner?
摘要:https://stackoverflow.com/questions/136097/difference-between-staticmethod-and-classmethod Maybe a bit of example code will help: Notice the differenc 阅读全文
posted @ 2021-07-02 19:28 guolongnv 阅读(34) 评论(0) 推荐(0)

上一页 1 2 3 4 5 下一页