Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import shutil
- out = open('file2.txt', 'w')
- for line in open('file.txt'):
- if line.strip() == '123':
- line = "AAAAAAAAAAA123\n"
- out.write(line)
- out.close()
- shutil.move('file2.txt', 'file.txt')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement