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

Twitter digest 2017 week 14

Posted by PyBites on Sun 09 April 2017 in Digest • Tagged with twitter, news, tips, python, safari books, cheatsheet, ruby, heroku, aws, Django, slack, alexa, data science, ebook, cron, machine learning, git • 2 min read

Every weekend we share a curated list of 15 cool things (mostly Python) that we found / tweeted throughout the week.


Continue reading

Twitter digest 2017 week 13

Posted by PyBites on Sun 02 April 2017 in Digest • Tagged with twitter, news, tips, beginners, Django, machine learning, mechanize, classes, Jupiter, cheat sheet, scrapy, data science, flask, tutorials, python • 1 min read

Every weekend we share a curated list of 15 cool things (mostly Python) that we found / tweeted throughout the week.


Continue reading

Twitter digest 2017 week 12

Posted by PyBites on Sun 26 March 2017 in Digest • Tagged with twitter, news, pycon, tips, debugging, itertools, pycharm, beginners, Django, rest, data science, flask, tutorials, python • 2 min read

Every weekend we share a curated list of 15 cool things (mostly Python) that we found / tweeted throughout the week.


Continue reading

Module of the Week - ipaddress

Posted by Julian on Thu 23 March 2017 in Modules • Tagged with python, tips, code, pybites, ipaddress, sysadmin, stdlib • 3 min read

While playing around with code for our post on generators we discovered the ipaddress module, part of the Standard Library. Such a handy little module!


Continue reading

Twitter digest 2017 week 11

Posted by PyBites on Sun 19 March 2017 in Digest • Tagged with twitter, news, pypi, Django, Flask, Pandas, cheat sheet, stdlib, APIs, tips, raspberry pi, json, pygame, tutorials • 2 min read

Every weekend we share a curated list of 15 cool things (mostly Python) that we found / tweeted throughout the week.


Continue reading

Generators are Awesome, Learning by Example

Posted by Julian on Fri 17 March 2017 in Concepts • Tagged with python, tips, code, pybites, generators, iteration, yield • 5 min read

Learn what a Generator is and check out some different examples.


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

Twitter digest 2017 week 10

Posted by PyBites on Sun 12 March 2017 in Digest • Tagged with twitter, news, podcasts, pypi, productivity, Django, Fire, Anaconda, cheat sheet, stdlib, CPython, microservices, APIs, tips • 2 min read

During the weekend we will share a curated list of 15 cool things (mostly Python) we found / tweeted during the week.


Continue reading

Comparing Lists with Difflib

Posted by Julian on Wed 08 March 2017 in Learning • Tagged with python, learning, beginners, stdlib, tips, cleancode, bestpractices, pythonic • 3 min read

Learn to compare blocks of text with the difflib module.


Continue reading