Created
August 31, 2015 16:55
-
-
Save xcombelle/21a9d0be9da438b76c95 to your computer and use it in GitHub Desktop.
sed like replace in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fileinput | |
| for line in fileinput.input(files=["test.txt"],inplace=True): | |
| print(line.replace("toto","toto tutu"),end="") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment