Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- {bla: ala}
- ]
- ---->
- [
- {bla: ala
- bla
- -----------------
- with fileinput.FileInput(filename,
- inplace = True, backup ='.bak') as f:
- for line in f:
- if "}\n]" in line:
- print(line.replace("}\n]",
- "\nbla"), end ='')
- else:
- print(line, end ='')
Advertisement
Add Comment
Please, Sign In to add comment