Closed xiaoxidashen closed 1 month ago
after print "WARNING: WatchFiles detected changes in 'test.py'. Reloading...", In case of Python 3.12, only i press ctrl + F5, one second later, terminal print NiceGUI ready to go on http://localhost:8080, and brower render updated content, if i don't press ctrl + F5, can not see updated content
i found use command in powershell is faster rather than use button in pycharm
It seems to be related to the integration method of the terminal.Could you provide your terminal setting details?
It seems to be related to the integration method of the terminal.Could you provide your terminal setting details?
I don't have any special settings. I use pycharm to create a new project, use Virtualenv as the python environment, and the terminal is when I click on the pycharm terminal, it automatically opens the powershell terminal with (.venv) loaded.
It is normal for me when i run code in pychram's terminal which doesn't support Crtl + F5
.
But for running it by click run button
,the output console which supports Crtl + F5
is the same as you said.
After i modify run configuration,enable emulate terminal in output console
,it is ok now.
Are you sure you run it in terminal? It's confused for me.
It is normal for me when i run code in pychram's terminal which doesn't support
Crtl + F5
. But for running it byclick run button
,the output console which supportsCrtl + F5
is the same as you said. After i modify run configuration,enableemulate terminal in output console
,it is ok now. Are you sure you run it in terminal? It's confused for me.
first the ctrl f5 is press in chrome brower , not pycharm second, i derect open powershell by windows terminal, without any config, follow is log
PS D:\Code\Python\Projects\hello\tmp> ..\.venv\Scripts\activate.ps1
(.venv) PS D:\Code\Python\Projects\hello\tmp> python .\test.py
NiceGUI ready to go on http://localhost:8080
WARNING: WatchFiles detected changes in 'test.py'. Reloading...
NiceGUI ready to go on http://localhost:8080
Need more details or pics or gifs, I can't reproduce your bug for now according your statement.
Need more details or pics or gifs, I can't reproduce your bug for now according your statement.
sorry, just create a pycharm python project, add code
from nicegui import ui
ui.label('123')
ui.run(reload=True)
then click run button, brower auto open page show above 123 lable, then change 123 to abc, and press ctrl s. you can see pycahrn print "WARNING: WatchFiles detected changes in 'test.py'. Reloading...", but brower never change anything. if you use command "python test.py" rather than click pycharm run button, you can find when you change py file , program correct auto reload in 1 second
same bug from pycharm (https://youtrack.jetbrains.com/issue/PY-63296/Pycharm-FastAPI-uvicorn-run-vs-terminal-differences-and-issue-with-slow-reloading-when-it-works).
similar bug from uvicorn (https://github.com/encode/uvicorn/issues/2000).
maybe root bug from pycharm (https://youtrack.jetbrains.com/issue/PY-60962/os.killpid-signal.CRTLCEVENT-ignored-when-running-python-program-from-Pycharm)
Sovle it temporarily by enabling Emulate terminal in output console
which is from https://www.cnblogs.com/aminor/p/17764109.html
(it's a chinese site,there are more details about this bug.You can use google translator to translate it.)
As @python-and-fiction mentioned, this seems to be a PyCharm problem and we can't do much about it. Therefore I'll close this issue.
Description
when i change py file, console immediately print "WARNING: WatchFiles detected changes in 'test.py'. Reloading..." and long time later (In case of Python 3.8 ,more than 10s,In case of Python 3.12, never auto reload), console print "NiceGUI ready to go on http://localhost:8080", brower changed, nicegui 1.4.29