会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
光辉-岁月
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
···
9
下一页
2022年2月21日
字符串的处理
摘要: 字符串的处理 保留两位小数 推荐 format demo = 20.30 print('这是format的方式:{:.2f}'.format(demo)) # 这是format的方式:20.30 print('这是的%%方式:%.2f' % demo) # 这是的%方式:20.30 note:注意%
阅读全文
posted @ 2022-02-21 14:31 疯狂列表推导式
阅读(44)
评论(0)
推荐(0)
2022年2月3日
连接MongoDB数据库
摘要: python 操作 MongoDB 创建连接 创建连接 from pymongo import MongoClient URI = 'mongodb://user:pwd@ip:port' client = MongoClient(URI) col = client['数据库'].集合 client
阅读全文
posted @ 2022-02-03 06:04 疯狂列表推导式
阅读(102)
评论(0)
推荐(0)
2021年12月16日
python 自带线程池模块
摘要: python 自带线程池 from concurrent.futures import ThreadPoolExecutor, as_completed import time brand_list = ['xiaomi', 'apple', 'vivo', 'oppo', 'meizu', 'sa
阅读全文
posted @ 2021-12-16 19:07 疯狂列表推导式
阅读(59)
评论(0)
推荐(0)
2021年12月9日
超时跳过、接收子线程结果
摘要: 超时跳过、接收子线程结果 方式一:eventlet 模块 缺点:针对子进程无法跳出 import time, eventlet eventlet.monkey_patch() with eventlet.Timeout(3, False): time.sleep(4) # 可能超时的代码块 prin
阅读全文
posted @ 2021-12-09 17:20 疯狂列表推导式
阅读(55)
评论(0)
推荐(0)
2021年11月25日
排序实际应用场景
摘要: 汉字、字母排序 from itertools import chain from pypinyin import pinyin, Style class sort(object): def __init__(self, iter_obj): self.iter_obj = iter_obj def
阅读全文
posted @ 2021-11-25 14:16 疯狂列表推导式
阅读(83)
评论(0)
推荐(0)
2021年11月13日
Debug Print
摘要: Debug Print demo = "zhongguo" print_var = lambda flag, var: print(f' {flag} \n{var}\n \n') print_var(0, demo) print_var('1', demo) 0 zhongguo 1 zhongg
阅读全文
posted @ 2021-11-13 16:01 疯狂列表推导式
阅读(126)
评论(0)
推荐(0)
2021年11月4日
lantern
摘要: 软件下载地址:https://github.com/getlantern/download 官网:https://GetLantern.org iPhone:https://github.com/getlantern/lantern/wiki/%E8%93%9D%E7%81%AFiOS%E5%AE%
阅读全文
posted @ 2021-11-04 22:00 疯狂列表推导式
阅读(1)
评论(0)
推荐(0)
2021年10月25日
windows 电脑设置 git
摘要: windows 电脑使用 git 软件 百度网盘:链接:https://pan.baidu.com/s/1CGkOFrcZh27niSd_3xhFog 提取码:v1mg 安装 安装 TortoiseGit-LanguagePack-2.11.0.0-64bit-zh_CN 非常容易安装完成。 安装
阅读全文
posted @ 2021-10-25 22:50 疯狂列表推导式
阅读(51)
评论(0)
推荐(0)
2021年10月24日
设置时间限制,等待任务结束
摘要: 设置时间限制,等待任务结束 import time print('start task and wait') waitflag = 0 timeline = 10 while True: time.sleep(60) print('check process and get result') tas
阅读全文
posted @ 2021-10-24 10:15 疯狂列表推导式
阅读(47)
评论(0)
推荐(0)
2021年10月21日
linux 常用命令
摘要: linux 命令 shell 基本语法 进程相关 杀掉进程 kill `ps -efww | grep 项目名 | grep -v grep | grep -v less | awk '{print $2}'` 查看进程号 ps -efww | grep 项目名 | grep -v grep | g
阅读全文
posted @ 2021-10-21 16:25 疯狂列表推导式
阅读(45)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
9
下一页
公告