#shell指令,批量传入
cat titleTest*.txt | python3 readFileTest2.py
#读取传入文件指定字段
#auto=wangshiyu
#File=readFileTest2.py
import sys
for line in sys.stdin:
start=line.find('<title')
end = line.find(('>'),len('>')+start)
print( line[start+7:end])
2024-03-22 08:13:30 阅读次数:43
#shell指令,批量传入
cat titleTest*.txt | python3 readFileTest2.py
#读取传入文件指定字段
#auto=wangshiyu
#File=readFileTest2.py
import sys
for line in sys.stdin:
start=line.find('<title')
end = line.find(('>'),len('>')+start)
print( line[start+7:end])
下一篇:数据库三级模式结构
课程介绍,基础—环境安装、判断、循环语句等(爬虫及数据可视化)
linux服务器安装pip命令
【python基础】学习路线
【后端】【语言】【python】python常见操作
【python】python 打印时间 python打印程序运行时间
【python C结构体】Python Ctypes结构体指针处理(函数参数,函数返回)
Blender下使用python设置骨骼旋转
Python 打包——过去、现在与未来
Python 中 -m 的典型用法、原理解析与发展演变
python编程入门(适合初学者)
文章
31309
阅读量
4469039
2024-12-10 07:13:11
2024-09-25 10:15:15
2024-09-24 06:30:51
2024-09-24 06:30:08
2024-07-18 10:18:05
2024-07-16 10:03:26
2023-04-27 07:57:16
2023-02-27 10:10:19
2023-03-21 03:15:34
2023-05-06 10:22:26
2023-03-30 10:07:24
2023-02-28 07:38:41