Trimming a string
wweston at att.net
Mon Aug 2 17:45:14 CEST 2004
Double Dumbass on You wrote:
> I have a string that is 7 characters and represents file mode in UNIX/LINUX
> from rpm:
> I don't care about the 0100 portion, I am only interested in the file
> permissions portion which is 755. How can I get three characters from the
> string starting at the right? ( -OR- strip 4 characters from the left? )
>>> x = "0100755"
>>> print x[4:]
Reading the tutorial is really time well spent.
More information about the Python-list