Skip to content

Compatibility with Flask #36

Open
Open
@MagnusOxlund

Description

@MagnusOxlund

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions