#-*-coding:utf-8-*- from flask import Flask app = Flask(__name__)
@app.route('/') def index(): f = open('mail_note.log','rb') #以读文件的方式打开mail_note.log文件 content = f.readlines()#按行读取日志 s = '' for each in content: s += each s += '</p>'#输出日志 f.close() return s
if __name__ == '__main__': app.run(host='0.0.0.0') #开发外网访问
#-*-coding:utf-8-*- from flask import Flask app = Flask(__name__)
@app.route('/') def index(): f = open('mail_note.log','rb') #以读文件的方式打开mail_note.log文件 content = f.readlines()#按行读取日志 s = '' for each in content: if 'gmail_helper.py' in each: #判定信息来自gmail_helper.py而不是discovery.py s += each s += '</p>'#输出日志 f.close() return s
if __name__ == '__main__': app.run(host='0.0.0.0') #开发外网访问