How to Write a Decorator with an Optional Argument?

Posted by Bob on Tue 11 April 2017 in Tips • Tagged with decorators, arguments, tricks, tips, cookbook • 3 min read

When playing with decorators (this week's challenge) I got stuck: how do you write a decorator that takes an optional argument? Python cookbook 3rd ed edition to the rescue. In this post how I failed my way to the right solution.


Continue reading

10 Tips to Get More out of Your Regexes

Posted by Bob on Wed 15 March 2017 in Tips • Tagged with regex, tips, parsing, regular expressions, findall • 5 min read

Regular expressions can be arcane, yet when used with care they can also be very powerful. In this post a couple of tips to get more out of your regexes when using Python's re module.


Continue reading

How to Order Dict Output in Python

Posted by Julian on Thu 16 February 2017 in Tips • Tagged with python, tips, tricks, code, pybites, dicts, data structures • 6 min read

Learn how to order the output of a Python Dict


Continue reading

Discover Python Help Options

Posted by Julian on Thu 02 February 2017 in Tips • Tagged with python, tips, tricks, code, pybites, help • 3 min read

Discover some of the numerous Python Help functions.


Continue reading