Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. file_in = open("irclog.txt")
  2. file_out = open("irclog_sorted.txt", "w")
  3. linelist = []
  4. sortedlist = sorted(file_in, key=len)
  5. for line in sortedlist:
  6. print(line)
  7. file_out.write(line)
  8. file_in.close()
  9. file_out.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement