Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. # ie List is a normal list:
  2. # 104.txt
  3. # 105.txt
  4. # 106.txt
  5. # 107.txt
  6. # 108.txt
  7.  
  8. # When done with code below should give me 5x files with a .txt extension, ie 104.txt, 105.txt. Can be any file ext.
  9.  
  10. List = open("64-120/rename.txt")
  11. List2 = (s.strip() for s in List)
  12. # Loop through the list and create a file with item
  13. for item in List2:
  14. open('64-120/%s.txt'%(item,), 'w')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement