from nltk.corpus import wordnet as wn
for i in wn.all_synsets():
    if i.pos() in ['a', 's']:
        for j in i.lemmas():
            if j.antonyms():
                pass
How to generate a list of antonyms for adjectives in WordNet using Python