loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.8605585073796838","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZnJvbSBmbGFzayBpbXBvcnQgRmxhc2sKYXBwID0gRmxhc2soX19uYW1lX18pCgpkZWYgZmFjdG9ycyhudW0pOgogIHJldHVybiBbeCBmb3IgeCBpbiByYW5nZSgxLCBudW0rMSkgaWYgbnVtJXg9PTBdCgpAYXBwLnJvdXRlKCcvJykKZGVmIGhvbWUoKToKICByZXR1cm4gIk9wZW4gdGhlIFVSTCBhbmQgZ28gdG8gL2ZhY3RvcnMvbnVtIHRvIHNlZSB0aGUgd2Vic2l0ZSIKCkBhcHAucm91dGUoJy9mYWN0b3JzLzxpbnQ6bnVtPicpCmRlZiBmYWN0b3JzX3JvdXRlKG51bSk6CiAgcmV0dXJuICJUaGUgZmFjdG9ycyBvZiB7fSBhcmUge30iLmZvcm1hdChudW0sIGZhY3RvcnMobnVtKSkKCmlmIF9fbmFtZV9fID09ICdfX21haW5fXyc6CiAgYXBwLnJ1bihob3N0PScwLjAuMC4wJyk="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from flask import Flask
app = Flask(__name__)

def factors(num):
  return [x for x in range(1, num+1) if num%x==0]

@app.route('/')
def home():
  return "Open the URL and go to /factors/num to see the website"

@app.route('/factors/<int:num>')
def factors_route(num):
  return "The factors of {} are {}".format(num, factors(num))

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