Jun-05-2017, 03:25 AM
i can convert binary characters to a literal text form with ascii() (repr() in py2) but it converts most characters to a hexadecimal escape form like '\x00\xff', with simpler control characters like newline converted to '\n'. but i want the octal escape form, like '\000\377'. this form can be used in source code literals. is there a function like ascii() that can give the octal form for bytes in range(256) (ok if it gives control escapes like '\n' for control characters like chr(10) instead of '\012')? i am hoping that i don't need to construct the result myself with a bunch of oct() calls.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.