def unsub():
if request.method == 'POST':
addr = request.form['addr'].lstrip().rstrip()
f = io.open('unsubscribers.txt', 'a', encoding="utf-8")
f.write(addr.decode('utf-8') + u'\r\n')
f.close()
f = io.open('static/whitelist.txt', 'r', encoding="utf-8")
lines = f.readlines()
f.close()
f = io.open('static/whitelist.txt', 'w', encoding="utf-8")
for line in lines:
if addr not in line:
f.write(line.decode('utf-8'))
f.close()
return render_template('unsubscribed.html',addr=addr)
评论列表
文章目录