python3 - jackssybin 的个人博客
python3 (5)
Python3绘图Turtle库详解
Turtle库是Python语言中一个很流行的绘制图像的函数库,想象一个小乌龟,在一个横轴为x、纵轴为y的坐标系原点,(0,0)位置开始,它根据一组函数指令的控制,在这个平面坐标系中移动,从而在它爬行的路径上绘制了图形。 turtle绘图的基础知识: 1. 画布(canvas) 画布就是turtle为我们展开用于绘图区域,我们可以设置它的大小和初始位置。 设置画布大小 turtle.screensize(canvwidth=None, canvheight=None, bg=None),参数分别为画布的宽(单位像素), 高, 背景颜色。 如:turtle.screensize(800,600, "green") turtle.screensize....
python3下chromedriver + headless + proxy+场景
1.标准头 # 导入selenium的浏览器驱动接口 from selenium import webdriver # 要想调用键盘按键操作需要引入keys包 from selenium.webdriver.common.keys import Keys # 导入chrome选项 from selenium.webdriver.chrome.options import Options chromeOptions.add_argument('--headless') #浏览器无窗口加载 chromeOptions.add_argument('--disable-gpu') #不开启GPU加速 ##解决报错: selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist) """ chromeOptions.add_ar....
centos7 安装chromedriver 有更新!
1.安装浏览器 指定yum 源 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 安装 curl https://intoli.com/install-google-chrome.sh | bash ldd /opt/google/chrome/chrome | grep "not found" 安装后,执行: google-chrome-stable --no-sandbox --headless --disable-gpu --screenshot https://www.baidu.com/ 成功之后会生成一个图片 查看 版本 很重要 google-chrome --version #Google Chrome 78.0.3904.108 #所以下载我们也只能下载对应的版本 2. 安装chromedriver 下载:https://npm.taobao.org/mirrors/chromedriver/ 索引 挑选自己系统匹配的 wget https:....
Centos7安装Python3.7
1.安装编译相关工具 yum -y groupinstall "Development tools" yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel yum install libffi-devel -y 2.下载安装包解压 cd #回到用户目录 wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz tar -xvJf Python-3.7.0.tar.xz 3.编译安装 mkdir /usr/local/python3 #创建编译安装目录 cd Python-3.7.0 ./configure --prefix=/usr/local/python3 make && make install 4.创建软连接 ln -s /usr/local/pyt....