Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cPickle, urllib2,re
- banner = []
- def unpickle(urltoopen):
- data = urllib2.urlopen(urltoopen).read()
- stream = cPickle.loads(data)
- return stream
- list1 = unpickle("http://www.pythonchallenge.com/pc/def/banner.p") #produces a tuple within a list within a list
- for i,m in enumerate(list1):
- for j,n in enumerate(list1[i]):
- banner[i] = list1[i][j][0]
- print banner
- """
- Traceback (most recent call last):
- File "python5.py", line 15, in <module>
- banner[i].append(list1[i][j][0])
- IndexError: list index out of range
- """
Advertisement
Add Comment
Please, Sign In to add comment