ImageGoNord-pip icon indicating copy to clipboard operation
ImageGoNord-pip copied to clipboard

Not operator

Open Wabri opened this issue 3 years ago • 3 comments

https://github.com/Schrodinger-Hat/ImageGoNord-pip/blob/0c58ca4b9794e1f2093469f31582f95c6b29dab3/ImageGoNord/GoNord.py#L137

You could use the not operator:

 if (not os.path.exists('../palettes/Nord/')): 

Wabri avatar Apr 26 '21 09:04 Wabri

Uhm, maybe the right way to do it is: if (os.path.exists('../palettes/Nord/')):

Because the exists method is returning a bool, always no matter what

TheJoin95 avatar Apr 26 '21 09:04 TheJoin95

Is I know how it work the os.path.exists method, but you compare a boolean with another boolean.

You want to do something if is false so you need the not operator to do it.

Wabri avatar Apr 26 '21 09:04 Wabri

Aah, yes, now I see what you was saying.

Yes, you are right. It's better to use the not operator. Let's change it into the future release

TheJoin95 avatar Apr 26 '21 09:04 TheJoin95

Closing this as won't do

TheJoin95 avatar Feb 22 '24 11:02 TheJoin95