说明:
1.tools.py 保存成一个文件
2.tools.css 保存成为一个文件
tools.py根据python3的语法编写tools.py
---------------------------------------------------------------------------------------------------------------
import re# Python文件搜索替换def string_switch(x):with open(x, "r", encoding="utf-8") as f:# readlines以列表的形式将文件读出lines = f.readlines()with open(x, "w", encoding="utf-8") as f_w:#定义一个数字,用来记录在读取文件时在列表中的位置n = 0#默认选项,只替换第一次匹配到的行中的字符串# 在行内查找长度数字pattern = re.compile(r'\d+?\.?\d+rem|\d+rem')  # 查找数字for line in lines:# 在行内查找长度数字y = pattern.findall(line)if len(y) > 0:if y[0] in line:# 长度除以3.5y = y[0].replace('rem','')z = str(round((float(y) / 3.5), 2))y1 = str(y)+'rem'z1 = str(z)+'rem'line = line.replace(y1, z1)f_w.write(line)string_switch('tools.css')

tools.css

----------------------------------------------------------------------------------------------------------------------------------------------------------------

.product {text-align: center
}/**banner**/
.product_banner {height: 3.2rem;
}.product_banner .banner > img {height: 3.2rem;width: 100%
}.product_banner .telecom-text {position: absolute;top: 1.71rem;left: 1.14rem;color: white;line-height: 0.34rem;font-size: 0.17rem;text-align: left;
}.product_banner .telecom-text p:first-child {font-size: 0.23rem;
}/**简介**/
.pr_introduction {margin-top: -0.03rem;
}.pr_introduction p {color: #aaa;line-height: 2em;font-size: 0.1rem;
}.pr_introduction p:first-child {font-size: 0.14rem;font-weight: bold;color: #0b0b0b;margin-bottom: 0.14rem;
}.pr_introduction > div {width: 7.43rem;margin: 0 auto;margin-top: 0.29rem;display: inline-block;
}.pr_introduction > div > div {float: left;width: 31%;height: 1.29rem;box-shadow: 0 3px 10px rgba(0, 0, 0, .1);display: flex;justify-content: space-between;text-align: left;border-radius: 0.03rem;margin: 0.09rem;
}.pr_introduction > div > div > div:first-child {margin: auto 0;text-align: center;margin-left: 0.09rem;
}.pr_introduction > div > div span {margin: 0.09rem;display: block;line-height: 0.17rem;
}.pr_introduction > div > div span:first-child {font-size: 0.1rem;font-weight: bold;margin-top: 0.14rem;
}.pr_introduction > div > div:hover {transform: translateY(-0.06rem);transition: transform .3s, box-shadow .3s;box-shadow: 0 2px 10px rgba(0, 0, 0, .1);color: #FFFFFF;background-color: #5d8cfe;
}.pr_introduction > div > div > img:hover {-webkit-filter: grayscale(0%);-moz-filter: grayscale(0%);-ms-filter: grayscale(0%);-o-filter: grayscale(0%);filter: grayscale(0%);filter:;
}.pr_introduction {padding-bottom: 0.48rem;padding-top: 0.29rem;background-color: #f9f9f9;
}/**第一屏幕**/
.pr_con1 {width: 100%;height: 3.43rem;/*background-color: #f9f9f9;*/
}.pr_con1 .pr_con1-content {width: 7.43rem;margin: 0 auto 0.41rem;display: inline-block;
}.pr_con1 .pr_con1-content div {float: left;height: 2.86rem;display: inline-block;margin-top: 0.37rem;
}.pr_con1 .pr_con1-content .pandect-left {width: 4.86rem;text-align: left;
}.pr_con1 .pr_con1-content .pandect-left img {height: 100%
}.pr_con1 .pr_con1-content .pandect-right {width: 2.57rem;text-align: left;font-size: 0.1rem;
}.pr_con1 .pr_con1-content .pandect-right h3 {font-size: 0.14rem;margin: 0.24rem 0;letter-spacing: 1px;text-align: center;font-weight: 300
}.pr_con1 .pr_con1-content .pandect-right p {margin-top: 0.14rem
}.pr_con1 .pr_con1-content .pandect-right p.suggest {color: #5789fe
}.pr_con1 .pr_con1-content .pandect-right ul li {list-style-type: none;width: 100%;float: left;height: auto;line-height: 0.17rem;
}.pr_con1 .pr_con1-content .pandect-right ul li.right_introduce_title {color: #5789fe;list-style-type: circle;margin-top: 0.09rem
}/**第二屏幕**/.pr_con2 {width: 100%;background-color: #f9f9f9;height: auto;
}.pr_con2 > p {padding: 0.29rem 0rem 0.29rem 0rem;font-size: 0.11rem;font-weight: bold
}.pr_con2 > ul {width: 6.86rem;margin: 0 auto;box-shadow: 0 3px 10px rgba(0, 0, 0, .1);
}
.pr_con2 div{height: 0.57rem;
}.pr_con2 > ul > li {max-height: 0.31rem;margin: auto 0;overflow: hidden;border-bottom: 1px solid #dce5fb;text-align: left;background-color: white;
}.pr_con2 > ul > li .top {display: flex;justify-content: space-between;font-size: 0.11rem;height: 0.31rem;color: #5789fe;line-height: 0.31rem;
}.pr_con2 .hauto .top {background-color: #5d8cfe;color: #ffffff;
}.pr_con2 > ul > li .top p:first-child {margin: 0.04rem 0.5rem
}.pr_con2 > ul > li .top p:first-child img {width: 80%;
}.pr_con2 > ul > li .top p:nth-child(2) {text-align: left;width: 90%;
}.pr_con2 > ul > li .top p:nth-child(3) {margin: auto 0;margin-right: 0.06rem
}.pr_con2 > ul > li .con {text-align: left;background-color: #FFFFFF;padding: 0.14rem;line-height: 0.14rem;
}.pr_con2 > ul > li .con div p:nth-child(1) {font-size: 0.11rem;color: #333;
}.pr_con2 > ul > li .con div p:nth-child(1) ~ p {color: #666;
}.pr_con2 > ul > li .con div p > strong {font-weight: bold;
}.pr_con2 .hauto {max-height: 3.43rem;transition: max-height .3s;
}

【食安云桥】python 文件内批量长度除以3.5替换相关推荐

  1. 如何把蓝奏云里的文件进行批量导出分享?蓝奏云批量分享的工具

    蓝奏云用的的多了,里面文件管理起来就非常的麻烦,在这里分享一下如何方便得批量分享蓝奏云中的文件. 首先需要下载一个软件 简单麦麦客户端 下载地址在 https://gitee.com/firesuir ...

  2. Python 文件数据批量录入数据库(MongoDB)

    引言: 我写博客的习惯基本上都是: 使用 Typora 或者 haroopad 这样支持 Markdown 语法的实时可视化编辑器先编写好,然后再发布到 CSDN 或者我自己的 hexo 博客地址上. ...

  3. Python 文件夹批量重命名

    代码: import os path='F:/CCUXiao/' dir=os.listdir(path) k=0 for i in dir:os.rename(os.path.join(path,i ...

  4. Python 文件夹重命名的两种方法

    Python 文件夹批量重命名 目录 Python 文件夹批量重命名 方法一(os.listdir): 1. 加前缀/后缀 2. 替换重命名 方法二(os.walk): 1. 加前缀/后缀 2. 替换 ...

  5. python批量替换网站静态文件内的域名

    最近在处理网站内的图片域名替换,由于大小专区网站众多(上百个),各网站均用静态文件发布器创建后生成html,css,js文件,要替换文件特别多,域名均写在页面源码里或js,css文件内,纯手工更改是不 ...

  6. json字段顺序读取 python_如何利用Python批量读取视频文件的时间长度?

    本期的主题是利用Python来实现对视频文件时间长度的读取. 在学习编程语言时,相比较于通过书本来学习知识,我更喜欢通过观看学习视频的方式来进行学习,通过主讲老师的讲解,我能很直观且快速的了解一些知识 ...

  7. python文件批量重命名以数字~n的方式重命名_利用Python对文件进行批量重命名

    最近几天工作的内容是对40个项目进行考核,每个项目都需要一个考核评分表,已经有了项目的列表. 如果用常规的方法,需要复制40个文件,并逐个修改,不光工作量大,也容易出错,后期修改也不方便. 于是想到了 ...

  8. 根据ID从FASTA文件中批量提取序列【Python】

    根据ID从FASTA文件中批量提取序列[Python] 生信问题记录 我的需求 input: FASTA文件,含六千余个蛋白序列.命名为FA.fasta txt文件,经过interpro注释后,筛选出 ...

  9. python 实现文件的批量压缩为.zip格式+.zip格式文件的解析

    python 实现文件的批量压缩为.zip格式+.zip格式文件的解析 python 实现文件的批量压缩为.zip格式 Python解析.zip文件的常见函数 python 实现文件的批量压缩为.zi ...

  10. 如何使用python快速完成批量导入一个文件夹下多个excel文件

    前两天一直想把1400多个excel文件导入到数据库中,上网搜索一直没找到对应的代码,大多是一个excel文件中多个表单的批量导入.作为小白的我试了很多次,终于在东拼西凑中写出来了一个比较实用的代码. ...

最新文章

  1. 递归/回溯:Subsets II求子集(有重复元素)
  2. python公共操作(运算符(+、*、in、not in)、公共方法(len()、del、max()、min()、range()、enumerate())、类型转换(tuple、list、set))
  3. 【jQuery】用jQuery给文本框添加只读属性【readOnly】
  4. MySQL之事务隔离级别--转载
  5. 学习笔记Hadoop(十三)—— MapReduce开发入门(1)—— MapReduce开发环境搭建、MapReduce单词计数源码分析
  6. elasticsearch使用优化备忘
  7. python局部变量含义_Python的变量
  8. 基于c#的相关性分析_不同区间衰退路径下锂离子电池的性能相关性及温度适用性分析...
  9. java 方法互斥_Java 两个互斥方法同时访问一个成员变量
  10. 中级软件设计师真题与答案(2009到2018)
  11. html中的表格背景透明度标签,透明度 背景
  12. 过滤掉Abp框架不需要记录的日志
  13. 信息熵与两种编码基础
  14. 快递系统java实验报告_快递管理毕业论文-基于java的物流快递管理系统设计
  15. 大海为什么是蓝色的?
  16. 识别连笔字的软件_在线手写文字识别软件快速代抄
  17. 华为智慧屏“两年”,从技术创新到引领电视产业变革
  18. 孙鑫Java视频教程(全12CD)
  19. $.inArray()方法
  20. python实现“艾宾浩斯”记忆曲线表

热门文章

  1. 前端数据可视化之使用 canvas、svg、zrender画图
  2. windows xp 64 位
  3. MATLAB调用cpp文件
  4. C++-从cpp文件到exe文件的过程
  5. 使用谷歌浏览器chrome截取长图
  6. 中级软件评测师下午题总结
  7. item_search - 按关键字搜索EBAY商品
  8. 腾讯云TRTCCalling实时音视频说明文档
  9. CVPR 2021最全论文开放下载!附pdf下载链接!
  10. [PKKS19] 《Revealing Scenes by Inverting Structure from Motion Reconstructions》(CVPR2019)阅读笔记(完)