Sunday, January 29, 2012

Python Rocks

Attended a great Python Workshop led by Hackers DC. Detailed and fast paced. Learned a ton.
Can't wait to write my own API!!!

Cool things I learned:

  • Join columns with tabs or commas
columns = []
for header in headers:
print '\t'.join(columns)
print ','.join(columns)

  • Generic try statement with pass instead of specifying an error:
       bank_name = data[0].text
       print bank_name

  • Randomize the frequency of url hits
%fake the user client

No comments:

Post a Comment