随笔 - 836  文章 - 1 评论 - 40 阅读 - 102万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

随笔分类 -  python

上一页 1 2 3 4 下一页
docker python crontab 定时任务
摘要:背景:有10以下定时任务,他们互不关联,需要放在server 上docker里面 run, 目前任务少,还未安装airflow , 临时方案 要将 crontab -e 命令的编辑器修改为 vim,你可以通过设置环境变量来实现。 1.临时: export EDITOR=vim 2.当前用户: ech 阅读全文
posted @ 2021-08-12 11:30 lshan 阅读(1047) 评论(0) 推荐(0) 编辑
pymongo cursor 非空判断 , 查询结果数量
摘要:今天处理游标非空判断,一直报错: 问题: DeprecationWarning: count is deprecated. Use Collection.count_documents instead 1.如果仅仅只需要数量: 当我使用pymongo查询出对应的cursor(find出的docume 阅读全文
posted @ 2021-08-11 18:47 lshan 阅读(2644) 评论(0) 推荐(0) 编辑
python 直接使系统环境变量
摘要:说明,在python代码中直接使用环境变量,并且给予默认值, 尤其在docker 发布时,可以通过环境变量修改参数 :-e JAVA_HOME=xxxx 直接使用: value = os.getenv("evn_name", "default") import os def os_environ(e 阅读全文
posted @ 2021-08-11 09:54 lshan 阅读(135) 评论(0) 推荐(0) 编辑
python 监听文件夹下的文件,将文本内容写入kafka,支持断电续传 (docker 发布) 看门狗(watchdog)
摘要:python 监听文件夹下的文件,将文本内容写入kafka,支持断电续传 (docker 发布) 1.代码 2.docker 部署 1.代码: pip install watchdog python 监听文件夹下的文件,将文本内容写入kafka,支持断电续传 (docker 发布) 1.代码: #! 阅读全文
posted @ 2021-08-03 11:44 lshan 阅读(412) 评论(0) 推荐(0) 编辑
python监控目录和文件变化
摘要:转载:https://www.cnblogs.com/lcamry/p/8392376.html 方式1: 一、os.listdir 二、FindFirstChangeNotification 三、ReadDirectoryChanges 四、watchdog 五、linux下pyinotify 一 阅读全文
posted @ 2021-08-02 17:03 lshan 阅读(482) 评论(0) 推荐(0) 编辑
python 定时框架APScheduler
摘要:pip install apscheduler APScheduler提供了七种调度器: BlockingScheduler:适合于只在进程中运行单个任务的情况,通常在调度器是你唯一要运行的东西时使用。 BackgroundScheduler: 适合于要求任何在程序后台运行的情况,当希望调度器在应用 阅读全文
posted @ 2021-07-20 16:57 lshan 阅读(105) 评论(0) 推荐(0) 编辑
python redis
摘要:显例: pip install redis import redis class RedisUtils(object): def __init__(self): if not hasattr(RedisUtils, 'pool'): RedisUtils.getPool() #创建redis连接po 阅读全文
posted @ 2021-07-20 14:50 lshan 阅读(89) 评论(0) 推荐(0) 编辑
SeleniumChromeUtils selenium 3.12.0
该文被密码保护。
posted @ 2021-07-19 18:56 lshan 阅读(3) 评论(0) 推荐(0) 编辑
mitmproxy 抓包工具(1)
摘要:官网:https://docs.mitmproxy.org/stable/addons-examples/ github: https://github.com/mitmproxy/mitmproxy/ mitmproxy 基本使用: EV: ubuntu16.04 python3.7 instal 阅读全文
posted @ 2021-07-18 15:46 lshan 阅读(157) 评论(0) 推荐(0) 编辑
python把html网页转成pdf文件
摘要:准备工作 那怎么办呢,python里面有个模块是pdfkit,他可以帮咱们把一个html(也就是一个网页)变成一个pdf文件。 pdfkit是python对wkhtmltopdf这个把网页转成pdf工具的一个封装,所以咱们必须得先安装一个wkhtmltopdf, 这个工具的下载网站是:https:/ 阅读全文
posted @ 2021-07-05 11:03 lshan 阅读(459) 评论(0) 推荐(0) 编辑
Selenium基于PIL实现拼接滚动截图(转)
摘要:原文: https://www.jb51.net/article/184464.htm Selenium Webdriver的 execute_cdp_cmd()来调用一下Chrome DevTools Protocal提供的方法。但是,很遗憾,没有全屏截图的方法。 Selenium2时,还可以使用 阅读全文
posted @ 2021-07-05 10:45 lshan 阅读(178) 评论(0) 推荐(0) 编辑
修改python 版本
摘要:修改python version 、修改python的默认版本(python2和python3切换) 1)将系统的默认python版本由python2修改为python3.(Python3修改为python2类似) echo alias python=python3 >> ~/.bashrc 2)同 阅读全文
posted @ 2020-09-16 17:16 lshan 阅读(2131) 评论(0) 推荐(0) 编辑
springCloud 调用Python web 服务(sideCard)(转)
摘要:原文请参考:https://blog.csdn.net/hliq5399/article/details/80540760 个人应用场景: 使用python 实现一些算法,然后通过java springboot 项目去调用。。。。 ********************************** 阅读全文
posted @ 2020-09-01 10:26 lshan 阅读(1547) 评论(0) 推荐(0) 编辑
kafka python 调试用(发送,接收)
摘要:kafkaProducer.py # encoding=utf-8 import json from kafka import KafkaProducer import time from backports.configparser.helpers import str def sendMsg(t 阅读全文
posted @ 2020-08-25 11:13 lshan 阅读(802) 评论(0) 推荐(0) 编辑
python 多线程(多个线程一起返回结果)
摘要:待整理: 测试代码: ''' Created on 2020年7月21日 @author: sea ''' from concurrent.futures.thread import ThreadPoolExecutor from concurrent.futures._base import as 阅读全文
posted @ 2020-07-21 18:43 lshan 阅读(991) 评论(1) 推荐(0) 编辑
ubuntu16.04 server 安装python2
摘要:由于16.04 server 默认安装python 3.X ,部分应用需要依赖2.7 原文:https://www.jianshu.com/p/743967c7ab1b 安装: 下载Python2包,最新的版本为2.7.15 wget https://www.python.org/ftp/pytho 阅读全文
posted @ 2020-06-20 13:52 lshan 阅读(1296) 评论(0) 推荐(0) 编辑
MySQL表结构映射为Python中的对象 python (SQLAlchemy)
摘要:原文:https://www.jb51.net/article/63585.htm 这篇文章主要介绍了简单地把MySQL表结构映射为Python中的对象的方法,用到了Python中的SQLAlchemy库,需要的朋友可以参考下 ORM mysql的表结构是二维表,用python的数据结构表示出来就是 阅读全文
posted @ 2020-06-18 18:14 lshan 阅读(1175) 评论(0) 推荐(0) 编辑
python pandas numpy
摘要:参考即可:https://www.yiibai.com/pandas https://www.yiibai.com/numpy 阅读全文
posted @ 2020-04-21 15:14 lshan 阅读(167) 评论(0) 推荐(0) 编辑
python数据分析之 pandas
摘要:参考该兄弟写的就可以了:https://www.jianshu.com/p/546839bbde8c 阅读全文
posted @ 2019-12-08 21:18 lshan 阅读(159) 评论(0) 推荐(0) 编辑
python 数据清洗之数据合并、转换、过滤、排序(转)
摘要:原文:https://blog.csdn.net/xwd18280820053/article/details/70655144 数据合并 在pandas中可以通过merge对数据进行合并操作。 import numpy as np import pandas as pd data1 = pd.Da 阅读全文
posted @ 2019-12-08 21:12 lshan 阅读(1288) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 下一页
点击右上角即可分享
微信分享提示