Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. import zipfile
  2.  
  3. def main():
  4.     open_order = ['90052.txt']
  5.     infile = open('channel/90052.txt', 'r')
  6.     while infile:
  7.         line = infile.readline().split()
  8.         if line[-1].isdigit():
  9.             open_order.append(line[-1] + '.txt')
  10.             infile = open('channel/' + line[-1] + '.txt')
  11.     comments = ''
  12.     inzip = zipfile.ZipFile('channel.zip')
  13.     for file in open_order:
  14.         zipcomment = inzip.getinfo(file).comment
  15.         comments += zipcomment
  16.     print comments
  17.        
  18. main()
  19.  
  20. this is the error:
  21.     if line[-1].isdigit():
  22. IndexError: list index out of range
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement