I am using the Python extension in Visual Studio Code and I use the green triangle button to run Python files.
However, that button doesn't rerun the file if the file is already running if I am working with a Flask or justpy app. If the app is already running and I press the button for a second time, I get the following output in the VS Code terminal:
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 "/Users/me/app/app1.py"
Instead of that I expect to get something like this:
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 "/Users/me/app/app1.py"
JustPy ready to go on http://127.0.0.1:8002
PyCharm is able to rerun a running justpy app, but not VSC. Is there a setting I should maybe change in VSC? Here is a sample justpy app if you want to give it a try:
import justpy as jp
def hello_world():
wp = jp.WebPage()
d = jp.Div(text='Hello world!')
wp.add(d)
return wp
jp.justpy(hello_world)
Edit: There is a workaround and that is to press CTRL + C or CMD + C in the terminal to stop the process and then run again, but that's just too cumbersome.