12 2024 档案
摘要:网页静默授权 access_token 作用: 网页授权access_token 有效期:7200ms 原理: 微信网页授权是通过OAuth2.0机制实现的,在用户授权给公众号后, 公众号可以获取到一个网页授权特有的接口调用凭证(网页授权access_token), 通过网页授权access_tok
阅读全文
摘要:第一种使用Q & query = model.objects(Q(ownerId=device.ownerId) & Q(devNo__nin=devNoList)) 第二种 直接并列 query = model.objects(ownerId=device.ownerId ,devNo__nin=
阅读全文
摘要:AT 指令 概念: 就是猫(Modem)的命令语言(Hayes公司发明) 作用: GSM(2G,3G,4G...)等交互通讯的命令 场景 4G cate1、cate4 移动模块(合宙,中移)等流行的模块用于物联网设备 最省钱的方案2G 2021年6月已經工信部下架不在批准申请,退网。 但是存量的依然
阅读全文
摘要:python 3.5 引入的一种注释语法 编译器自动忽略 仅仅IDE识别使用 x = 1 # type: int y = 'hello' # type: str 函数的注释 可以通过 doc 获取 from functools import wraps def my_decorator(func):
阅读全文
摘要:数据转换和处理 from cytoolz import itertoolz # 使用accumulate累积运算 nums = [1, 2, 3, 4] cumulative_sums = itertoolz.accumulate(nums) print(list(cumulative_sums))
阅读全文
摘要:指定位置写0 GPIO->ODR=&~(2<<1) 指定位置写1 GPIO->ODR=l(2<<1) 读取高电位 // 如果该位是0, 全部是0,处于低电平状态 // 不能判断 == 1 (GPIOA->IDR & LED) == 0
阅读全文
摘要:需要指定版本 pika 0.10.0 # coding=utf-8 import pika if __name__ == '__main__': credentials = pika.PlainCredentials('taskmanager', 'dayuan666') connection_pa
阅读全文
摘要:汉字转拼音 # coding=utf-8 from pypinyin import pinyin, lazy_pinyin, Style def contains_chinese(txt): for ch in txt: if u'\u4e00' <= ch <= u'\u9fff': return
阅读全文
摘要:按照数量返回 db.getCollection("xxxx").aggregate([ { $match: { "daily.incomeMap": { $exists: true } } }, { $group: { _id: "$groupId", totalCount: { $sum: 1 }
阅读全文
摘要:警告 CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will
阅读全文
摘要:报错如下 python27 DependencyWarning: SOCKS support in urllib3 requires the installation of optional dependencies: specifically, PySocks. For more informat
阅读全文
摘要:方法 if callable(getattr(smartBox, 'get_receipt_button1', None)): pass 对象访问 class IncomeMap(dict): @property def totalIncome(self): return RMB(self.get(
阅读全文