会员
周边
新闻
博问
闪存
赞助商
YouClaw
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
凌晨的集市人不多
首页
新随笔
管理
[置顶]
51job_001
摘要: #!/usr/bin/python # -*- coding: utf-8 -*- from selenium import webdriver import xlwt,csv,time import os # os.remove('51job爬虫.xls') startup_Options = w
阅读全文
posted @ 2021-07-03 22:36 Avicii_2018
阅读(167)
评论(0)
推荐(0)
2026年5月10日
os.path.exists()
摘要: file_path= r'./extract.yaml' if not os.path.exists(file_path): os.startfile(file_path) 在现代 Python 开发中,我们推荐使用 pathlib(处理路径)和 subprocess(执行命令)模块。 from p
阅读全文
posted @ 2026-05-10 18:13 Avicii_2018
阅读(3)
评论(0)
推荐(0)
with open() 打开文件 文件被占用 except PermissionError
摘要: def write_yaml_data(self,value): """ 写入数据到yaml文件 """ file_path= r'./extract.yaml' # if not os.path.exists(file_path): # os.startfile(file_path) try: w
阅读全文
posted @ 2026-05-10 17:31 Avicii_2018
阅读(2)
评论(0)
推荐(0)
字典的get()方法
摘要: user = {'name':'Alex','age': 18} 普通查询(直接通过键访问): user['name'] 如果你查询一个不存在的键, 程序会直接报错(KeyError)并崩溃 使用.get() 方法: user.get('name') 如果你查询一个不存在的键, 程序不会报错, 而是
阅读全文
posted @ 2026-05-10 17:17 Avicii_2018
阅读(3)
评论(0)
推荐(0)
2025年4月8日
接口数据写入Excel(写入表头和数据行)
摘要: """ Author: Created: Description: """ import time from openpyxl import Workbook result = [{'id': 105, 'name': '010医院', 'phonenumber': '1353369010', 'a
阅读全文
posted @ 2025-04-08 23:08 Avicii_2018
阅读(53)
评论(0)
推荐(0)
2024年12月25日
告警处理 Unresolved attribute reference 'status_code' for class 'object'
摘要: 代码中有如下告警: 1. Unresolved attribute reference 'status_code' for class 'object' 这个错误通常出现在使用Python进行编程时,尤其是在使用类似于Django或Flask这样的Web框架时。它意味着你尝试在一个类的实例中访问一个
阅读全文
posted @ 2024-12-25 20:43 Avicii_2018
阅读(228)
评论(0)
推荐(0)
下一页