Demo entry 6787232

hi

   

Submitted by anonymous on Apr 11, 2019 at 03:36
Language: Python 3. Code size: 751 Bytes.

# =====================================================================================================================
# =====================================================================================================================
if '__main__' == __name__:

    # make sure python is 3. 
    print(f"Saving ignore list file to: {_WORDS_PATHNAME}")

    # split consumes tab newline and space and multi space
    words_clean = set(_words.strip().replace(',', ' ').replace(';', ' ').split())

    with open(_WORDS_PATHNAME, 'wb') as fh:
        for word in words_clean:
            line = word.strip() + '\n'
            fh.write(line.encode('utf8'))
    
    print('Done')
    print(f'Wrote {len(words_clean)} words.')

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).