![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
幻影七幻
程序猿
展开
-
Python windows 定时执行
1.win 任务计划程序,控制面板页面——》搜索计划任务。2. 在Windows中点击创建任务。5.触发器选择(每天, 开始(启动时间))4.触发器 ——》新建。3.常规,创建任务名。原创 2023-05-26 17:12:40 · 228 阅读 · 0 评论 -
cmd 键入Python 没有反应
后来查到是因为在windows10下面需要配置。键入python没有反应,安装python时发现在。原创 2022-11-15 11:11:10 · 1332 阅读 · 0 评论 -
猿人学第三题
猿人学第三题原创 2022-10-08 14:38:07 · 155 阅读 · 0 评论 -
gitee 的使用
pycharm 中git的使用原创 2022-09-23 16:45:03 · 1271 阅读 · 0 评论 -
猿人学 第一题
猿人学第一题原创 2022-09-16 13:52:42 · 506 阅读 · 0 评论 -
pycharm github 使用
pycharm git使用原创 2022-07-22 18:12:50 · 4157 阅读 · 1 评论 -
CMD 执行Python脚本 卡死
CMD 执行Python脚本 卡死原创 2022-06-30 10:44:33 · 1735 阅读 · 1 评论 -
Python 生成器与迭代器
生成器与迭代器详解原创 2022-06-21 14:15:45 · 480 阅读 · 1 评论 -
【无标题】Python lambda 初探
匿名函数 lambda方法初探原创 2022-06-20 17:43:23 · 78 阅读 · 0 评论 -
Python在ide中可以运行,黑窗口不能运行 根目录问题 ModuleNotFoundError: No module named
由于Python找不到根目录导致的问题:解决办法1:import sysimport ossys.path.append(os.path.dirname(sys.path[0]))或者import sysimport os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))sys.path.insert(0, BASE_DIR)方法2:...原创 2022-03-21 09:44:29 · 575 阅读 · 0 评论 -
2021-11-10
到ddLatest supported Visual C++ Redistributable downloads | Microsoft DocsThis article lists the download links for the latest versions of Visual C++ Redistributable packages.https://docs.microsoft.com/zh-CN/cpp/windows/latest-supported-vc-redist?vie原创 2021-11-10 10:22:48 · 56 阅读 · 0 评论 -
时间格式转换
import datetimea = '30 Nov. 2020'a = 'February 12, 2018'aa= str(datetime.datetime.strptime(a, '%B %d, %Y'))[:10]print(aa)结果2018-02-12原创 2021-09-26 17:41:47 · 65 阅读 · 0 评论 -
python apscheduler was missed by
可以通过追踪源码,进行调试在执行器中没有发现问题,在调度器中发现每次调度器创建任务发现调度逻辑1.调度器异步调度执行器2.调度器返回等待时间,(休眠进入下次执行时间)3.执行器开始执行4.执行完毕返回调度器由于在自己的调度代码中添加了(用于超时协程任务时间)import eventleteventlet.monkey_patch()并且有多进程任务from multiprocessing import Process, Managerfor i in temp:..原创 2021-08-31 10:19:02 · 1063 阅读 · 0 评论 -
scrapy 代理池
scrapy 代理池https://zhuanlan.zhihu.com/p/60474099转载 2021-07-08 11:21:30 · 152 阅读 · 0 评论 -
pymong 添加唯一索引 pymongo.errors.DuplicateKeyError
添加索引 :db.test1.createIndex({name: 1},{unique: true}); #name 为关键词 unique : 唯一索引db.test1.getIndexes() #查询索引python插入重复数据的时候出现 pymongo.errors.DuplicateKeyError 错误。try: db.test1.save(post)except pymongo.errors.DuplicateKeyError: print(111)...原创 2021-06-29 17:25:22 · 468 阅读 · 0 评论 -
python 装饰器
最简单的运行时间装饰器:import timedef deco(func): #装饰器名字 def wrapper(): 装饰器内部的方法 startTime = time.time() func() #需要被执行的方法 endTime = time.time() msecs = (endTime - startTime)*1000 print("time is %d ms" %msecs)原创 2021-06-28 16:44:19 · 69 阅读 · 0 评论 -
python openpyxl #Value!
出现这种情况一般是由于在一个单元格中有值,然后单元格值为空,调整格式求和的时候发现值错误:例:A1(1)--> ' ' -->[h]:mm -->求和发生错误(#Value!)修改后A1(1)--> None -->[h]:mm -->求和发生错误(#Value!)添加内容为:sheet.cell(row=1, column=1).value = Noneopenpyxl的关键词:sheet.cell(row=sheet[coo...原创 2021-06-26 17:15:30 · 499 阅读 · 0 评论 -
python selenium 版本问题导致无法打开模拟器 打开直接跳异常
1,查看自己google浏览器的版本:2.chrom地址:http://chromedriver.storage.googleapis.com/index.html原创 2021-05-29 10:36:43 · 146 阅读 · 1 评论 -
Python 全局设置国内源(清华源) 地址(解决pip 国内安装过慢导致超时问题)
临时使用pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package注意,simple不能少, 是https而不是http设为默认升级 pip 到最新的版本 (>=10.0.0) 后进行配置:pip install pip -Upip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple如果您到 pip...原创 2021-05-28 17:31:20 · 6138 阅读 · 0 评论 -
win10 python 脚本开机自启
1.构建test.py脚本,放到D盘中的Test文件夹中#test.pyimport timefor i in range(100): print(i) time.sleep(1)2. 进入地址(C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp)直接复制此地址到文件搜索框中,(打开c盘中也许你看不到ProgramData文件,直接数据路径就可以到达需要地址)创建run.txt...原创 2021-04-25 13:40:50 · 1737 阅读 · 0 评论 -
python cmd 运行脚本 ModuleNotFoundError: No module named
此情况是由于自己写的包找不到根目录导致在自己创建便宜文件的时候,进行要有__init__.py此文件表示是一个python的包在自己运行文件入口添加:import sysimport oscurPath = os.path.abspath(os.path.dirname(__file__))rootPath = os.path.split(curPath)[0]sys.path.append(rootPath)把根目录添加到环境中,此段代码尽量放置到文件开头处...原创 2021-03-13 13:05:21 · 268 阅读 · 0 评论 -
pyppeteer 异常处理 ValueError: signal only works in main thread
使用定时器出现pyppeteer 异常'handleSIGINT':False,'handleSIGTERM': False,'handleSIGHUP': False,self.browser = await launch(handleSIGINT=False, handleSIGTERM=False, handleSIGHUP=False, .原创 2021-03-10 10:17:45 · 464 阅读 · 1 评论 -
python pip 更新失败
python -m pip install --upgrade pip -i https://pypi.douban.com/simple原创 2021-03-03 14:22:15 · 4664 阅读 · 0 评论 -
测试代理ip是否生效 Python requests
http://icanhazip.com原创 2021-02-08 17:36:21 · 241 阅读 · 0 评论 -
Chrome webdriver 获取页面信息
test_txt = driver.page_source原创 2021-02-01 18:48:27 · 1748 阅读 · 0 评论 -
python requests timeout不起作用 卡死
在使用python 的requests进行数据请求时不设置timeout大部分时候,是会有超时异常的,超时时间大概是20多秒但是有时候超时会不起作用需要自己制定超时时间,使用timeout=60response = requests.get(url, headers=headers, proxies=proxies,timeout=60)但是有时候设置此参数之后仍然会有几分钟甚至是十几分钟没有返回结果可以使用timeout=(50, 60)timeout参数也可以传入一个包含两个简单浮点数原创 2021-01-29 15:13:12 · 3196 阅读 · 0 评论 -
scrapy安装 error: Microsoft Visual C++ 14.0 or greater is required.Twisted- on this platform.
安装scrapy会显示Microsoft Visual C++版本过低,自己更新版本,失败后后采用Twisted的方式进行安装解决办法:http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted下载下载twisted对应版本的whl文件(如我的Twisted‑17.5.0‑cp36‑cp36m‑win_amd64.whl),cp后面是python版本,amd64代表64位,)注意自己python环境一定要和teisted的版本对应,不然会出错p.原创 2020-12-26 10:14:17 · 146 阅读 · 1 评论 -
fake_useragent.errors.FakeUserAgentError: Maximum amount of retries reached异常
直接上手,不多bbfake_useragent中存储的UserAgent列表发生了变动,而本地UserAgent的列表未更新所导致的,在更新fake_useragent后报错就消失了。pip install -U fake-useragentPython的其他包也可以用这种方法完成更新pip install -U 包名。...原创 2020-11-27 14:55:19 · 204 阅读 · 1 评论 -
mongo安装出错
MongoDB安装过程中出现service MongoDB failed to start,verify that you have sufficient privileges to start...打开(services.msc)服务界面,找到MongoDB Server,右键->属性->登录,登录身份选择本地系统账户(L)。原创 2020-11-05 13:11:54 · 128 阅读 · 0 评论 -
python apscheduler WARNING: Run time of job “job (trigger: cron[hour=‘5‘], next run at:
coalesce:当由于某种原因导致某个job积攒了好几次没有实际运行(比如说系统挂了5分钟后恢复,有一个任务是每分钟跑一次的,按道理说这5分钟内本来是“计划”运行5次的,但实际没有执行),如果coalesce为True,下次这个job被submit给executor时,只会执行1次,也就是最后这次,如果为False,那么会执行5次(不一定,因为还有其他条件,看后面misfire_grace_time的解释) max_instance: 就是说同一个job同一时间最多有几个实例再跑,比如一个耗时10分钟的原创 2020-11-05 09:25:50 · 2586 阅读 · 0 评论 -
python 大众 同城
大众价格import requestsfrom lxml import etreeclass main: def get_count(self, uncode_list): try: count = "" for uncs in uncode_list: if uncs in self.woff.keys(): cc = self.woff[uncs]原创 2020-08-17 16:07:16 · 215 阅读 · 0 评论 -
python logging 配置 输出 测试 根据时间生成日志文件,每天一个日志文件
链接https://www.cnblogs.com/xianyulouie/p/11041777.html原创 2020-08-07 17:50:15 · 6325 阅读 · 0 评论 -
手机appium 手机抓包 模拟器 xposed
1.appium安装使用教程b站 :白夜黑羽python搜索手机模拟器链接appium2.手机安装xposedhttps://www.secshi.com/31267.htmlhttps://blog.csdn.net/xiangshangbashaonian/article/details/802306643.抓包工具charles和手机模拟器模拟器https://www.cnblogs.com/xiaoshidi/p/6878295.html网上搜索教程,主要是配置cha原创 2020-08-11 10:21:01 · 585 阅读 · 0 评论 -
python 正则re表达式
python 正则re表达式re.match函数re.match(pattern, string, flags=0)| pattern | 匹配的正则表达式 ||–|--|| | |原创 2020-07-24 11:23:34 · 130 阅读 · 0 评论