I'm a school teacher who spent the summer writing a vocab training program in python that uses text available from wikipedia and gutenberg. Now all I have to do is figure out a way to filter out curse words so that I can distribute to students.
Normally I would just have an array (list) of those curse words and do a simple filter. The problem though is that the py file itself it openable by these students, seeing those words. If I put it in a separate file, somehow encrypted, then they could just delete that file and the output wouldn't be filtered.
Any ideas for workarounds?
Why not distribute the compiled python .*pyc files instead?  They could still lookup the strings if they wanted, but it will likely deter casual browsing of the file, which may be sufficient for your needs.
How to "hide" curse words in a py file?