There are very little tools to do this offline without using unknown executables, so follow this guide to learn in Python!
A part of learning python is understanding the use of list comprehensions and how or when to use them, this post aims to tackle the basics of applying list comprehensions and explaining what it is. What are List Comprehensions? List comprehensions provide a concise way to create lists and transform
What is the best way to do it? Depending on your viewpoint, either option could be, but what about for processing a ridiculously long string?