Fix Python – How to emulate a do-while loop?

I need to emulate a do-while loop in a Python program. Unfortunately, the following straightforward code does not work:
list_of_ints = [ 1, 2, 3 ]
iterator = list_of_ints.__iter__()
element = None

while True:
if element:
print element

element =
except StopIteration:

print “done”

Instead of “1,2,3,do….

Fix Python – How to download a file over HTTP?

I have a small utility that I use to download an MP3 file from a website on a schedule and then builds/updates a podcast XML file which I’ve added to iTunes.
The text processing that creates/updates the XML file is written in Python. However, I use wget inside a Windows .bat file to download the actual MP3 file. I would prefer to have the entire u….

Fix Python – Convert list of dictionaries to a pandas DataFrame

How can I convert a list of dictionaries into a DataFrame? Given:
[{‘points’: 50, ‘time’: ‘5:00’, ‘year’: 2010},
{‘points’: 25, ‘time’: ‘6:00’, ‘month’: “february”},
{‘points’:90, ‘time’: ‘9:00’, ‘month’: ‘january’},
{‘points_h1’:20, ‘month’: ‘june’}]

I want to turn the above into a DataFrame:
month points points_h1 time year
0 ….

Fix Python – Convert a String representation of a Dictionary to a dictionary

How can I convert the str representation of a dict, such as the following string, into a dict?
s = “{‘muffin’ : ‘lolz’, ‘foo’ : ‘kitty’}”

I prefer not to use eval. What else can I use?
The main reason for this, is one of my coworkers classes he wrote, converts all input into strings. I’m not in the mood to go and modify his classes, to deal with ….