Guest User

Untitled

a guest
Feb 24th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. openfile = open('name.txt')
  2. for line in openfile.readlines():
  3. myfile = open(line + ".txt", mode='w')
  4. myfile.write("text " + line.strip() 'n')
  5. myfile.close()
  6.  
  7. OSError: [Errno 22] Invalid argument: 'TEST00000n.txt'
  8.  
  9. openfile = open('name.txt')
  10. for line in openfile.readlines():
  11. myfile = open(line.rstrip() + ".txt", mode='w')
  12. myfile.write("text " + line.strip()+'n')
  13. myfile.close()
Add Comment
Please, Sign In to add comment