Python/Django Tips n' Tricks Cheatsheet

Posted by: scoopseven 12 years, 2 months ago

Converting a unicode string to a list of strings
http://stackoverflow.com/questions/5001385/unicode-to-python-object-conversion
n = [e.encode('utf-8') for e in s.strip('[]').split(',')]

Converting a list of longs to a list of intsnew_list = [int(e) for e in queryset]

Current rating: 3


Recent Tweets

Recent Posts

Archive

2013
2012
2011
2010
2009
2008
2007
2006

Categories

Authors

Feeds

RSS / Atom