Tuesday, 17 September 2013

Python - Remove very last character in file

Python - Remove very last character in file

After looking all over the internet, I've come to this.
Let's say I have a already made text file that reads: Hello World
Well I want to remove the very last character --In this cased-- from the
text file.
So now the text file should look like this: Hello Worl
But I have no idea how to do this.
All I want, more or less, is a single backspace function for text files on
my hdd.
This needs to work on Linux as that's what I'm using. Thanks!

No comments:

Post a Comment