Python, How to do deleting work in a file? -


i know position of file pointer,and want delete preceding char.

of course can create file,writing in left content,which not way want.

in other word,i want "inplace".thank you.

for line in fileinput.input('file.txt', inplace=true):     line = ... # edit line     print line, # stdout redirected file 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -