Pycharm inside after use PIL library, why not call the Image method code hints pop-up, how to make code hints pop-up?

Reference: https://blog.csdn.net/weixin_34376562/article/details/85947598

After previously we have encountered this problem, install the pillow no code hints, check for a long time and finally found the problem turned out very simple, the solution also does not make sense.

The reason why there is no code hints, just because Pycharm not judge Image.open () returns an object of type
so you need to let Pycharm know the type of the object.
Recommended Use

the Assert isinstance (img, Image.Image)   # assertion is not Image.Image type img judge is attempting to tell pycharm this type can then have code completion

 

 

Guess you like

Origin www.cnblogs.com/lonelyshy/p/12569043.html