Problem : Suppose you have a dictionary like: {‘a’: 1, ‘c’: {‘a’: 2, ‘b’: {‘x’: 5, ‘y’ : 10}}, ‘d’: […]
Category: Python
Is there a built in function for string natural sort?
Problem : I have a list of strings for which I would like to perform a natural alphabetical sort. For […]
Local variables in nested functions
Problem : Okay, bear with me on this, I know it’s going to look horribly convoluted, but please help me […]
How to serve static files in Flask
Problem : So this is embarrassing. I’ve got an application that I threw together in Flask and for now it […]
Annotate bars with values on Pandas bar plots
Problem : I was looking for a way to annotate my bars in a Pandas bar plot with the rounded […]
How to install packages offline?
Problem : What’s the best way to download a python package and it’s dependencies from pypi for offline installation on […]
“inconsistent use of tabs and spaces in indentation”
Problem : I’m trying to create an application in Python 3.2 and I use tabs all the time for indentation, […]
How to send email attachments?
Problem : I am having problems understanding how to email an attachment using Python. I have successfully emailed simple messages […]
Zip lists in Python
Problem : I am trying to learn how to “zip” lists. To this end, I have a program, where at […]
Converting unix timestamp string to readable date
Problem : I have a string representing a unix timestamp (i.e. “1284101485”) in Python, and I’d like to convert it […]