Ryen's Blog

知识就是力量

Centos7.9.2009 重新安装python和yum

Centos 重新安装python和yum 卸载python rpm -qa|grep python|xargs rpm -e --allmatches --nodeps ​ whereis python|xargs rm -fr 卸载yum rpm -qa|grep yum|xargs rpm -e --allmatches --nodeps ​ rm -rf /etc/yum.repos.d/* ​ whereis yum|xargs rm -fr 安装python mkdir /usr/local/src/python wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-2.7.5-89.el7.x86_64.rpm wget http://mirrors.163.com/centos/7.9.2009/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm

python爬虫UserAgent伪装库

在找资料的时候我发现一个库fake_useragent,这个库可以伪装请求头,具体用法 from fake_useragent import UserAgent ua = UserAgent() #ie浏览器的user agent print(ua.ie) #opera浏

关于python脚本执行推送的另一条路(非server酱)

一.失去无限制的免费推送 因为微信发布公告将在4月底下线模板消息,Server酱开发了以企业微信为主的多通道新版( Turbo版 sct.ftqq.com ),旧版将在4

Python3 使用requests模块显示下载http视频并且显示进度

效果图就不上了 用了才知道好 改了大半天 麻烦死了 上代码 import re import urllib import requests.packages.urllib3 import time import os from urllib.request import urlopen import requests from tqdm import tqdm class Getfile(): #下载文件 def __init__(self,url): self.url=url #self.filename=filename self.re=requests.head(url,allow_redirects=True) #运行head方法时重定向

如何使用Python对图片批量打水印

为了节省博客空间或者想加快图片加载和加快网站进入速度,所以只能采用图床或者存储,就不能使用插件自动加水印,但是一张张手动也会更加麻烦,所以p

Python爬虫编码格式问题GB2312转换utf8

在最近的图片爬虫中遇到的问题是:爬取网页得到的结果如下(部分) 里面的中文出现乱码。 <!DOCTYPE html> <html lang='zh-CN'> <head> <meta charset='gb2312'> <meta content='IE=edge' http-equiv='X-UA-Compatible'> <title>2017Äê

Centos7 使用 nohup后台运行python程序

在服务器上,为了退出终端,程序依然能够运行,需要设置程序在后台运行。 1. 安装nohup yum install coreutils 2. 后台运行python程序 nohup python3 -u test.py > test.log 2>&1 & nuhup : 不挂