Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- openfile = open('name.txt')
- for line in openfile.readlines():
- myfile = open(line + ".txt", mode='w')
- myfile.write("text " + line.strip() 'n')
- myfile.close()
- OSError: [Errno 22] Invalid argument: 'TEST00000n.txt'
- openfile = open('name.txt')
- for line in openfile.readlines():
- myfile = open(line.rstrip() + ".txt", mode='w')
- myfile.write("text " + line.strip()+'n')
- myfile.close()
Add Comment
Please, Sign In to add comment