Apply control characters to a string - Python
问题 I'm trying to apply control characters, such as '\x08 \x08' that should remove the precedent char, to a string (move backwards, write space, move backwards) For example when I type into python console : s = "test\x08 \x08" print s print repr(s) I get in my terminal : tes 'test\x08 \x08' I'm looking for a function, let's says "function", that will 'apply' control characters to my string : v = function("test\x08 \x08") sys.stdout.write(v) sys.stdout.write(repr(v)) so I get a "clean", control