Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ie List is a normal list:
- # 104.txt
- # 105.txt
- # 106.txt
- # 107.txt
- # 108.txt
- # When done with code below should give me 5x files with a .txt extension, ie 104.txt, 105.txt. Can be any file ext.
- List = open("64-120/rename.txt")
- List2 = (s.strip() for s in List)
- # Loop through the list and create a file with item
- for item in List2:
- open('64-120/%s.txt'%(item,), 'w')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement