The question about pycharm

pycharm

Jun.09,2022

this is a detection function that comes with PyCharm

the original words are as follows:

This inspection highlights local variables,parameters or local functions unused in the scope

this check highlights unused local variables, parameters, or local functions in the scope

clipboard.png

while tk.StringVar () does not return a Python string object,
and button_text=' closes the window', which is equivalent to directly "overwriting" the original variable, that is to say, you did not use the button_text variable twice, so it will be grayed out.

as for the object returned by tk.StringVar (), please refer to this boss's article:
https://blog.csdn.net/wuxiush...

.
Menu