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

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

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

uitableview - Create and use custom prototype table cells in xamarin ios using storyboard -