Not a bot. Daily curated Python snippets and tips for new and experienced Python developers. Tweet your best snippets!

Joined July 2015
Photos and videos
Robert Wilson's top 5 Python modules of 2015. My favorite - tqdm - adds a progress bar with only one line of code. j.mp/1Vd71Zz

1
4
Daily Python Snippet retweeted
Using mocks? Read this! engineeringblog.yelp.com/201… Everyone has this. :-(

12
128
158
Ever wanted to use a GOTO statement in your Python code? Now it's possible! Insane decorator patches your bytecode: j.mp/1OKLy9c

TIOBE Index for September 2015: j.mp/1KnyowT x.com/gvanrossum/status/6436…

Whoa, Python is ahead of PHP on the Tiobe index now?! :-)
1
Daily Python Snippet retweeted
Yeah, so Python 3.5.0 is really out! python.org/downloads/release… Thanks all Python core contributors!
13
562
343
Daily Python Snippet retweeted
It's today! Tickets will be on sale at 3pm UTC! Yay! Check time here: time.is/compare/1500_17_Aug_…. See you in November! 🚗🎸

1
15
8
Daily Python Snippet retweeted
Thinking about organizing a #DjangoGirls event in your city, but not sure what's involved? There's a manual for that! organize.djangogirls.org/

7
2
Daily Python Snippet retweeted
IPython 4.0 is out, completing the initial transition to Jupyter blog.jupyter.org/2015/08/12/…

4
145
84
A great decorator that retries a function until it returns True. Configurable retries, delay & exponential backoff: j.mp/1IBAi8P

Want to memoize (see previous tip) in Python 2? The memoized class is very convenient. Snippet from the Python wiki: j.mp/1MVzhPc

Memoizing your Python function? Python 3 has the functools.lru_cache decorator. j.mp/1IBz90T

Daily Python Snippet retweeted
#python tip: In Python 3, you can simulate the Python 2 cmp(a,b) function with: (a > b) - (a < b)
1
17
39
Decode HTML entities in #Python string j.mp/1MVx1HE Thanks @PythonDaily!

1
"The __init__.py files are required to make Python treat the directories as containing packages" x.com/PythonDaily/status/629…

What is __init__.py for? - bit.ly/1dthWqg
Create multiple independent iterators from a single iterator using itertools.tee. Partitioning a collection: j.mp/1MVvZeK

1
Daily Python Snippet retweeted
#python tip: s.rstrip() # remove all whitespace (spaces, tabs, newlines, etc) s.rstrip(' ') # remove only space characters
3
26
44
Daily Python Snippet retweeted
#python tip: The str.startswith() and endswith() methods support an argument tuple: supported = url.endswith(('.html', '.xml', '.css'))
4
127
159
You can modify globals(), but never locals(). You can modify x locally using exec("x=y"), but only in Python 2, not 3 j.mp/1hifQ68