
python
小小的木头人
这个作者很懒,什么都没留下…
展开
-
ERROR: No matching distribution found for pandas
利用国内镜像拉取。原创 2023-01-11 16:48:55 · 1626 阅读 · 0 评论 -
py3 redis通用调用
记录一个python通用的调用类。原创 2022-07-15 17:56:07 · 261 阅读 · 0 评论 -
requests.utils 保存 cookies和字符串str互相转换
cookies转成str字符串先将cookies转成字典,在将字典转换成字符串 import requests.utils import json def save_cookies(files_path, _data): """" 保存cookies成文件 files_path: 文件保存路径 _data: 需要保存的参数 """ f = open(files_path, 'w', encodin.原创 2022-05-25 20:11:18 · 1558 阅读 · 0 评论 -
-bash: pip: command not found pip命令报错 解决方法(Centos版)
下载wget https://bootstrap.pypa.io/pip/2.7/get-pip.py安装python get-pip.py检查(有版本 可忽略4、5步骤)pip -V查找pip路径find / -name pip将pip添加到系统命令ln -s /usr/local/python/bin/pip /usr/bin/pip原创 2022-04-29 16:59:10 · 1397 阅读 · 0 评论 -
py xlrd3 读取excl
# -*- coding: utf-8 -*-import xlrd3'''1. 打开一个excel对象2. 读取excel中的所有表单名称3. 打开excel中的目标表单4. 读取目标表单中的有效行数5. 读取目标表单中的有效列数6. 读取目标表单中的某个单元格数据7. 读取目标表单中每个单元格'''# 打开一个excel表格E:\\info.xlsxtargetExcel = xlrd3.open_workbook("E:\\info.xlsx")# 获取excel表格原创 2022-02-15 22:26:55 · 565 阅读 · 0 评论 -
py3 链接mysql
# -*- coding: UTF-8 -*-import pymysql# 打开数据库连接db = pymysql.connect(host='192.168.1.6', user='root', passwd='admin', port=3307, database='hxjxequities')# 使用 cursor()原创 2022-02-14 16:28:47 · 327 阅读 · 0 评论 -
python 简单的post请求
# -*- coding: utf-8 -*-import randomimport os, threading, datetimeimport requests, jsondef createPhone(): prelist = ["130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "147", "150", "151", "152", "153", "155", "15原创 2021-08-06 18:18:42 · 591 阅读 · 0 评论 -
py 随机生成一个电话号码
# -*- coding: utf-8 -*-import randomdef createPhone(): prelist=["130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "147", "150", "151", "152", "153", "155", "156", "157", "158", "159", "186", "187", "188"原创 2021-08-06 10:54:48 · 560 阅读 · 0 评论 -
xlrd.biffh.XLRDError: Excel xlsx file; not supported
原因:xlrd更新到了2.0.1版本,只支持.xls文件解决办法:安装旧版xlrdpip uninstall xlrdpip install xlrd==1.2.0原创 2021-05-19 23:20:45 · 388 阅读 · 0 评论 -
selenium + python 滚动到页面底部
1)driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")2)js = "var q=document.documentElement.scrollTop=1000"driver.execute_script(js)原创 2020-08-24 16:53:13 · 3353 阅读 · 0 评论 -
python 上传模块 paramiko安装
pip install paramiko通过pycharmFile --> setting -->原创 2020-08-11 10:50:42 · 469 阅读 · 0 评论 -
Python 、selenium 安装及简单运用
一、Python安装1、安装包下载官网下载地址:https://www.python.org/downloads/windows/下载文件名:Windows x86-64 executable installer2、安装python* 如果版本不同可能安装包名称有所变动,我本地安装包名:python-3.8.4-amd64.exe *1)自定义安装目录,然后 install 开始安装2)安装完成后,cmd 输入python 提示无命令等,就需要配置环境变量(安...原创 2020-07-21 12:00:22 · 453 阅读 · 0 评论 -
centons 升级python
https://blog.youkuaiyun.com/u011798443/article/details/80825817转载 2018-10-30 12:03:57 · 328 阅读 · 0 评论