following code cause MyThread object running twice.
import threading
import time
from flask import Flask
class MyThread(threading.Thread):
def __init__(self):
super().__init__()
self.event = threading.Event()
def run(self):
print("Hello")
app = Flask(__name__)
t1 = MyThread()
t1.start()
app.run(host='0.0.0.0', port = 19001, debug = True)
set debug as False can avoid this problem but why is that? Is that a feature?