# !/user/bin/env python
# -*- coding: utf-8 -*-
"""==================================================
@author: cyairhp
@time : 2021/5/7 23:29
@file : countRowNum.py
@desc :
=================================================="""
path = r'E:\python\培训课件\p6-常用文件处理\code\testdata\test6-4.txt'
with open(path, 'r') as f:
contents = f.read()
lines = contents.split('\n')
print(repr(lines[-1]))
if not lines[-1]:
print('最后一行为空行')