loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.5299655547595175","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZnJvbSBmbGFzayBpbXBvcnQgRmxhc2ssIHJlbmRlcl90ZW1wbGF0ZSwgc2Vzc2lvbgphcHAgPSBGbGFzayhfX25hbWVfXykKIyBBZGQgdGhlc2UgZXh0cmEgdHdvIGxpbmVzCmFwcC5zZWNyZXRfa2V5ID0gJ3MzY3IzdCcKYXBwLmNvbmZpZ1snU0VTU0lPTl9UWVBFJ10gPSAnZmlsZXN5c3RlbScKCkBhcHAucm91dGUoJy8nKQpkZWYgaG9tZSgpOgogIHggPSBzZXNzaW9uLmdldCgneCcsIE5vbmUpIAogIGlmIG5vdCB4OgogICAgc2Vzc2lvblsneCddID0gMQogIGVsaWYgeD49MTA6CiAgICBzZXNzaW9uLmNsZWFyKCkKICAgIHJldHVybiAiU2Vzc2lvbiBDbGVhcmVkIgogIGVsc2U6CiAgIHNlc3Npb25bJ3gnXSs9MQogIHJldHVybiAiTnVtYmVyIG9mIHJlZnJlc2hlczogIitzdHIoc2Vzc2lvblsneCddKQoKaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzoKICBhcHAucnVuKGhvc3Q9JzAuMC4wLjAnKQo="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from flask import Flask, render_template, session
app = Flask(__name__)
# Add these extra two lines
app.secret_key = 's3cr3t'
app.config['SESSION_TYPE'] = 'filesystem'

@app.route('/')
def home():
  x = session.get('x', None) 
  if not x:
    session['x'] = 1
  elif x>=10:
    session.clear()
    return "Session Cleared"
  else:
   session['x']+=1
  return "Number of refreshes: "+str(session['x'])

if __name__ == '__main__':
  app.run(host='0.0.0.0')