python
lukezhang-123
博客好强大!注意保护视力!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
edge selenium获取加载的url列表python3
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ 下载对应自己现在版本的driver C:\Users\win\AppData\Local\Programs\Python\Python37\Scripts\pip.exe install msedge-selenium-tools selenium==3.141 #!/usr/bin/python # -*- coding: utf-8 -*- from sele原创 2021-01-09 18:47:24 · 874 阅读 · 0 评论 -
python算法0/1背包问题
一维数组循环 #!/usr/bin/python # -*- coding: utf-8 -*- """ https://zhuanlan.zhihu.com/p/78060568 1) input: 4 5 物品总数 不超过总重量 1 2 重量 价值 2 4 3 4 4 5 output: 8 https://en.wikipedia.org/wiki/Knapsack_problem 2) input: 10 67 23 505 26 352 20 458 18 220 32 354 2原创 2020-12-06 15:25:49 · 296 阅读 · 1 评论 -
python日志logging多线程使用
通过下面demo,学会python的logging使用,多线程使用,运行 app.py里的main然后看日志 app.py #!/usr/bin/python # -*- coding: utf-8 -*- import logging import thread_job # logging.basicConfig(filename='myapp.log', # format='%(asctime)s %(module)s %(filename)s %(func原创 2020-12-05 11:04:25 · 5987 阅读 · 1 评论 -
python多线程任务处理模板
#encoding:utf-8 import threading def task_thread(task_data): print task_data return task_data all_task=[] all_task.append(1) all_task.append(1) all_task.append(1) all_task.append(1) t...原创 2020-02-18 14:04:49 · 454 阅读 · 0 评论 -
python遍历生成ffmpeg命令bat实现视频批量转换
通过python生成avi转mp4命令后,存入.bat执行,实现视频批量转换 #encoding:utf-8 import os for root,dirs,files in os.walk(r"E:\data"): for file in files: fileName=os.path.join(root,file) if (fileName.endsw...原创 2020-02-03 20:51:49 · 1081 阅读 · 1 评论 -
python2爬取姓名
单线程版,访问后直接写入文件,适合小内存 多线程版,子线程访问后把结果存入list,最后主线程写入文件,占内存 python 2.7.5 pip install beautifulsoup4 #encoding:utf-8 import codecs import urllib2 from bs4 import BeautifulSoup def getHtml(urlStr): h...原创 2020-01-31 22:11:21 · 706 阅读 · 0 评论 -
python推荐算法itemCF基于物品的协同过滤
# itemCF Demo # python 3.7 import numpy as np import math # test data users=["u1","u2","u3"] item_like_list=["a,b,c","a,b,c,e,f","a,e"] # 单个商品喜欢人数 def check_1item(item): return sum(list(map(lamb...原创 2020-01-09 17:04:00 · 1035 阅读 · 0 评论 -
python3利用beautifulsoup4库实现【html爬虫】处理汽车品牌大全
``py -m pip install beautifulsoup4`` import urllib.request from bs4 import BeautifulSoup with urllib.request.urlopen('http://car.bitauto.com/qichepinpai/') as url: s = url.read() soup = Beautif...原创 2019-10-08 20:29:23 · 258 阅读 · 0 评论
分享