You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to use watch with Flask, but the output doesn't appear in the terminal until after the Flask application has terminated.
from watchpoints import watch
from flask import Flask
app = Flask('app')
x = None
watch(x)
@app.route('/')
def change_x():
global x
x = "Something" # no output until after app.run terminates
print("manual print") # prints immediately
return x
app.run('0.0.0.0', 500, debug=True, use_reloader=True)
Is there a way to output immediately?
The text was updated successfully, but these errors were encountered:
Ah, that's actually a bug for watchpoints. watchpoints does not deal with global variables well. Also I'll have to be honest that this library has not been actively maintained. Personally I loved this black magic library but not there are not a lot of active users to make maintenance worthy.
I'm surprised to hear that. I can't imagine a better way to monitor variables that are involved in a complex interaction. Personally, I'm dealing with cached quasi-global proxy objects and hooks or signals being accessed by external modules I'm still getting to know. It can take quite a while to track down issues.
I only just discovered your project yesterday. Hopefully it will garner more attention and catch on.
I've been trying to use
watch
with Flask, but the output doesn't appear in the terminal until after the Flask application has terminated.Is there a way to output immediately?
The text was updated successfully, but these errors were encountered: