# -*- coding: utf-8 -*- # t11-tail.py — 应用日志尾部(读最后 60 行) import io, sys sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') with open('logs/crm-app.log', 'r', encoding='utf-8', errors='replace') as f: lines = f.readlines() print(''.join(lines[-60:]))