tuankiet65

Sort TPP links

Jun 14th, 2014
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. #!/usr/bin/env python2
  2.  
  3. import sys
  4.  
  5. f=open(sys.argv[1], 'r')
  6. a=f.read().split("\n")
  7. f.close()
  8.  
  9. a.pop()
  10. a.sort(key=lambda x:x[-14:-4])
  11.  
  12. f=open(sys.argv[1], 'w')
  13. f.write("\n".join(a))
  14. f.close()
Advertisement
Add Comment
Please, Sign In to add comment