ошибка при построении tkinter GUI для запуска Flask сервера - PullRequest
0 голосов
/ 13 июля 2020

Я пытаюсь создать GUI, который запускает flask сервер

from tkinter import *
from flask import *


app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'


def start_server():
    app.run(host='0.0.0.0', debug=True)

root = Tk()

b = Button(root, text = "start server",command = start_server)
b.pack()


root.mainloop()

, когда я нажимаю кнопку запуска сервера, я получаю что-то вроде этого

Warning -- threading_cleanup() failed to cleanup 0 threads (count: 4, dangling: 24)
Dangling thread: <echo_server(Thread-53, stopped 8688)>
Dangling thread: <echo_server(Thread-45, stopped 8656)>
Dangling thread: <ReaderThread(pydevd.Reader, started daemon 1800)>
Dangling thread: <echo_server(Thread-47, stopped 8376)>
Dangling thread: <echo_server(Thread-46, stopped 2052)>
Dangling thread: <echo_server(Thread-40, stopped 12744)>
Dangling thread: <echo_server(Thread-38, stopped 10616)>
Dangling thread: <echo_server(Thread-49, stopped 9940)>
Dangling thread: <echo_server(Thread-44, stopped 9712)>
Dangling thread: <echo_server(Thread-43, stopped 14552)>
Dangling thread: <echo_server(Thread-48, stopped 7356)>
Dangling thread: <WriterThread(pydevd.Writer, started daemon 12816)>
Dangling thread: <echo_server(Thread-50, stopped 2976)>
Dangling thread: <_MainThread(MainThread, started 4676)>
.
.
.

кто угодно знает, как заставить это работать Я много искал и ничего не нашел

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...