4 Reusable Code Snippet Topics
Remove Filter | |
With the advent of Python33 the module time has received a high resolution timer/counter. Here we use time.perf_counter() in a decorator to conveniently time two test functions. | |
A simple way to find duplicate words in a text. In this case the text is preprocessed to eliminate punctuation marks and set all words to lower case. | |
This short snippet shows you how to preprocess a text to remove punctuation marks, then do a word frequency count using Counter() from the Python module collections. Finally, two sorts are applied to display words with matching frequency in alphabetical order. | |
I started using Python a few weeks ago, something finally clicked and I started writing tools for my personal use. I started writing something with a GUI using GTK and the code lines started multiplying rapidly, so I thought to myself "Am I commenting my source to death? How many … |
The End.