用类方法和静态方法实现:一个是追加写文件一行内容,一个是读指定行号的内容 #coding=utf-8 class handle_file(object): def __init__(self,file_path): self.file_path=file_path @classmethod def write_file(cls,file_path,content): with open(file_path,'a') as
1.具体实现 #!usr/bin/env python # -*- coding:utf-8 -*- from flask import Flask,render_template,request,redirect from pager import Pagination from urllib.parse import urlencode app = Flask(__name__) @app.route('/pager') def pager(): li = [] for i in range