版权声明:原创文章转载请声明出处 https://blog.csdn.net/qq_40374604/article/details/83445898
#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])