当前位置:网站首页>Pychart always displays the collecting data solution after entering the debug mode

Pychart always displays the collecting data solution after entering the debug mode

2022-06-09 21:07:00 Not thin, 8-jin ball cake

1. Problem description

In use PyCharm Conduct Python When code debugging looks at specific variables , Show collecting data, Finally, an error is reported Timeout waiting for response, You can't see the internal contents of variables in the interface .

( my Pycharm The version is 2020.2)

2. terms of settlement

File/Settings/, open Setting Interface , Check... In the following figure in the setting item Gevent compatible.

3.Gevent compatible

If you select this check box , The debugger will Gevent-monkeypatched Code compatibility .

About Gevent-monkeypatched:

Gevent Is a collaborative multitask Library . It works the way you , The programmer , Organize your code into something called greenlets Work unit of . When given greenlet Running time , It will run alone . When it reaches a point where it will block , in other words , It must wait for some external signal , Such as file 、 Overtime 、 Our network data ,greenlet Should be passed to gevent Send signals to cooperate ,gevent Will arrange some other greenlet function . Once the waiting data is ready , The previous execution will be resumed .

Now? ,Python The standard library of stdlib( once ?) Non cooperative mode . The standard behavior is to stop selfishly , Not to gevent Issue to pause a greenlet The signal of . This can lead to a problem , Because only the first greenlet Running , Others will never have a chance to be arranged .

Gevent-monkeypatched The goal of is to replace stdlib Blocking calls in , So that existing code can take advantage of greenlet Without rewriting .


Reference link :

Python Debugger Explanation of several setting options _ Ziyan Ruoshui's blog -CSDN Blog

原网站

版权声明
本文为[Not thin, 8-jin ball cake]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206092046195349.html