def buildEscape(theType, theValue): if theType == "hex" or theType == "hexadecimal": if theValue.startswith("0x"): theValue = f.withoutFirst(f.withoutFirst(theValue)) return EscapeStarters.hexadecimal + theValue elif theType == "octal" or theType == "oct": return EscapeStarters.octal + theValue elif theType == "unicode": return EscapeStarters.unicode + theValue elif theType == "esc" or theType == "escape": return EscapeStarters.hexadecimal + theValue