辰深 published on included in 2019 技术 实例 算术运算和文件写入的例子 def process(num1, num2, file): result = num1 / num2 with open(file, 'w', encoding='utf-8') as f: f.write(str(result)) 定义了一个 process 方法,接收三个参数,前两个参数是 num1 和 num2,第三个参数是 file。
辰深 published on included in 2019 技术 :::tip PyQt5编程 ::: 工具 记录为公司人员写的便携操作数据库房源数据程序, UI与逻辑层分离,使用 Qt Designer + PyQt5完成。pycharm配置PyUIC
辰深 published on included in 2019 技术 RYP有限公司 Flask workon flaskvir [root@izwz94gdegum84cnrx9rtoz ~]# cd pythoncode/mysqlinit [root@izwz94gdegum84cnrx9rtoz mysqlinit]# pwd /root/pythoncode/mysqlinit [root@izwz94gdegum84cnrx9rtoz mysqlinit]# ls dump.rdb infos logs manage.py migrations __pycache__ requirements.txt utils [root@izwz94gdegum84cnrx9rtoz mysqlinit]# ps -ef | grep gunicorn root 4319 1 0 Nov18 ? 00:01:39 /root/.env/flaskvir/bin/python3.7 /root/.env/flaskvir/bin/gunicorn -w 20 -b 0.0.0.0:5000 manage:app root 4726 4319 0 Nov18 ? 00:00:21 /root/.env/flaskvir/bin/python3.7 /root/.env/flaskvir/bin/gunicorn -w 20 -b 0.0.0.0:5000 manage:app [root@izwz94gdegum84cnrx9rtoz mysqlinit]# kill PID [root@izwz94gdegum84cnrx9rtoz mysqlinit]#
辰深 published on included in 2019 技术 :::tip Redis搭建爬虫代理IP池 ::: # -*- coding: utf-8 -*- """ @file: proxy.py @desc: 爬虫IP代理池 @Author: Chenzq @Wechat: 15690833097 @contact: czq181020@gmail.com """ import json import requests import redis import datetime, time from taobao_sale.settings import (REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, PROXY_POOL_COUNT, PROXY_PULL_COUNT, PROXY_URL) class RedisClient(object): def __init__(self, host=REDIS_HOST, port=REDIS_PORT): if REDIS_PASSWORD: self._db = redis.StrictRedis(host=host, port=port, password=REDIS_PASSWORD)
辰深 published on included in 2019 技术 步骤 使用 Fiddler 抓取公众号接口数据 使用 Python 脚本获取公众号所有历史文章数据 保存历史文章 Fiddler 抓包 使用微信桌面客户端,打开某个公众号的历史文章,这里以我的公
辰深 published on included in 2019 技术 ::: warning Windows下编辑shell脚本编码问题 在windows下编辑的文件远程传送到linux下的时候每行末尾都会出现^M,这将导致shel