# coding=utf-8 # !/usr/bin/python # -*- coding: UTF-8 -*- import io import os def file_chance(): #修改文件内某一行的内容 f = open('text1', 'r') w = open('text2', 'w') n = 0 for i in f: n += 1 if n == 3: i = "yes,i am\n" w.write(i) f.close() w.close() os.re
RuntimeError: The session is unavailable because no secret key was set. Set the secret_key on the application to something unique and secret. 解决办法是 app = Flask(__name__) app.config[' session 必须带有['SECRET_KEY'] ,可以随机写一个,也可以自己使用python自带生成随机数模块,生成一个写上.