remove a directory with special chars

andy andy at wild-flower.co.uk
Sat Mar 18 17:38:06 EST 2006


Is there a special reason you want to use Python to do this?  The Linux
command shell would probably do exactly the same job (you can specify
backslash-escaped characters at the command-line)...

anyway to do it in python:

  import os
  os.remove("/path/to/the/file/.\177\177")

Note that under Linux, hidden files start with a "." - that's what makes
them hidden.

By the way, "\177" (decimal 79) is a letter "O"... I suspect you meant
"\011" (decimal 9) which is backspace...

Hope that helps,
-andyj




More information about the Python-list mailing list