Stopword_list
用于NLP的停用词stopword.txt
return [line.strip() for line in open('./stopword.txt', 'r', encoding='utf-8').readlines()]
移除不可见字符
def remove_upprintable_chars(s):
"""移除所有不可见字符"""
return ''.join(x for x in s if x.isprintable())
时间
时间戳偏移
datetime.datetime.now() + datetime.timedelta(days=-1)
# days、seconds、microseconds、milliseconds、minutes、hours、weeks
时间戳转为可阅读时间
>>> time.asctime(time.localtime(time.time()))
# out:'Mon Nov 8 17:18:50 2021'
字符串转json保留中文json.dumps(a, ensure_ascii=False)
安卓的杂项
ADB调试
adb devices -l 列出连接的设备
adb install