![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
进击的小阿万
这个作者很懒,什么都没留下…
展开
-
bbs项目实战
bbs项目实战原创 2023-02-13 08:01:22 · 291 阅读 · 0 评论 -
多线程的TCP协议服务端实现 socketserver(包含粘包详解)
多线程服务端、粘包处理原创 2023-01-12 23:59:57 · 634 阅读 · 0 评论 -
Python中eval函数和json和pickle 笔记
Python中eval()函数、json、pickle笔记原创 2023-01-07 22:52:47 · 178 阅读 · 0 评论 -
利用selenium获取接口数据
selenium获取接口数据原创 2022-10-10 18:06:58 · 3619 阅读 · 0 评论 -
pip加速
pip加速镜像原创 2022-06-19 20:52:31 · 860 阅读 · 0 评论 -
EMR查询可用去zone的demo
emr_demo原创 2022-06-19 20:51:12 · 135 阅读 · 0 评论 -
openpyxl自动设置列宽
openpyxl自动设置列宽原创 2022-06-19 15:42:06 · 3528 阅读 · 0 评论 -
openpyxl批量删除表格中的空白行,并处理数据样式
openpyxl批量删除表格中的空白行,并处理数据样式原创 2022-06-19 15:00:06 · 2477 阅读 · 0 评论 -
(EC2)价格抓取demo
'''#想使用select方法,但是代码里不是select表单元素,而是awsui-select元素,故放弃select_2 = Select(dr.find_element_by_xpath('//*[@id="e-c2next"]/div/div[2]/awsui-form/div/div[2]/span/span/div[2]/div/div/div[1]/div[2]/div/div[2]/span[3]/awsui-table/div/div[2]/div/div[2]/span/div/d原创 2021-04-22 00:47:40 · 214 阅读 · 1 评论 -
使用openpyxl库打开表时,tionWarning: Call to deprecated function get_sheet_by_name (Use wb[sheetname])
使用openpyxl库时,打开表操作中遇到如下报错:DeprecationWarning: Call to deprecated function get_sheet_by_name (Use wb[sheetname])可将sheet.get_sheet_by_name('name')替换成sheet['name']方可解决原创 2020-08-29 08:53:23 · 1340 阅读 · 0 评论 -
python连接远程mysql程序demo
先上demo:#!/usr/bin/env python # -*- coding:utf-8 -*-# author: Frank time:2020/8/21import pymysqlclass Mysql: def __init__(self): self.content = pymysql.Connect( host='X.X.X.X', # mysql的主机ip port=3306, # 端口原创 2020-08-22 14:39:00 · 163 阅读 · 0 评论 -
连接远程mysql时遇到的问题详解
遇到问题:web项目连接远程(服务器)mysql 2003错误连接超时连接mysql数据库时抛出pymysql.err.OperationalError解决办法:第一步:修改mysql配置文件让其他主机可以访问mysql服务例如:[mysqld]character-set-server = utf8bind-address = 0.0.0.0port = 3306配置文件在/etc/my.cnf.d/mysql-server.cnf查找一下命令为:find / -name mysql-se原创 2020-08-22 14:34:21 · 194 阅读 · 0 评论 -
python+selenium常用方法封装
demo如下:#encoding=utf-8from selenium import webdriverfrom Util.KeyBoardUtil import KeyBoardKeysfrom Util.ClipboardUtil import Clipboardimport time#定义全局变量driverdriver = Nonedef open(browserName): #打开浏览器 global driver,waitUtil try:原创 2020-08-13 00:39:18 · 1117 阅读 · 0 评论 -
python+selenium获取元素and显示等待的方法封装
获取元素的demo如下:from selenium.webdriver.support.ui import WebDriverWaitimport timefrom selenium import webdriver#获取单个页面元素对象def getElement(driver,localtorType,localtorExpression): try: element = WebDriverWait(driver,5).until(lambda x:x.find_el原创 2020-08-12 23:50:31 · 716 阅读 · 1 评论 -
python+selenium封装excel关键字
先上demo#encoding=utf-8import openpyxlfrom openpyxl.styles import Border, Side, Fontimport timeclass ParseExcel(object): def __init__(self): self.workbook = None self.excelFile = None self.font = Font(color = None) # 设置字体的颜原创 2020-08-12 23:44:04 · 283 阅读 · 0 评论 -
pip安装时总是timeout的办法
在安装软件的时候,指定源的位置,一般用阿里云的源,阿里云: https://mirrors.aliyun.com/pypi/simple/中国科技大学: https://pypi.mirrors.ustc.edu.cn/simple/豆瓣(douban) :https://pypi.douban.com/simple/清华大学: https://pypi.tuna.tsinghua.edu.cn/simple/中国科学技术大学:https://pypi.mirrors.ustc.edu.cn/si原创 2020-08-12 23:30:40 · 465 阅读 · 0 评论 -
Python中关于time的封装使用
demo#!/usr/bin/env python# -*- coding:utf-8 -*-# author: Frank time:2020/8/9import timeimport datetimeimport locale# 获取当前的日期def get_current_date(): time_tup = time.localtime() current_date = str(time_tup.tm_year) + "年" + str(time_tup.tm原创 2020-08-09 23:58:59 · 170 阅读 · 0 评论 -
Python中一种更好看的测试报告BeautifulReport
先上demoimport unittestfrom BeautifulReport import BeautifulReport as bf #导入BeautifulReport模块,这个模块也是生成报告的模块,但是比HTMLTestRunner模板好看class XXX(unittest.TestCase) def setup() pass def test_1() print('第1个用例') def test_2() print('第2个用例') def test_3()原创 2020-08-09 23:27:56 · 858 阅读 · 1 评论 -
Python中email模块的封装使用
先上demo:from email.mime.multipart import MIMEMultipartfrom email.mime.text import MIMETextfrom email.mime.image import MIMEImagefrom email.header import Headerfrom time import strftime, localtime ,sleepdef send_email(dest_email,file_path,report_name,原创 2020-08-09 23:22:03 · 330 阅读 · 0 评论 -
Python中单独打印“\”
填写路径时有时需要输入‘\’,但是单独打印不出’’print(’’) 报错:SyntaxError: EOL while scanning string literal正确打印方式:print(’\’)原创 2020-08-09 22:15:55 · 990 阅读 · 0 评论