octal encoding - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: octal encoding (/thread-6708.html) |
octal encoding - Skaperen - Dec-04-2017 is the explicit octal sequence encoding supposed to be available or not in string literals?
RE: octal encoding - wavic - Dec-04-2017 '\007' RE: octal encoding - DeaD_EyE - Dec-04-2017 b'\377' == b'\xff' and int('0o377', 8) == 0o377 == 0xff == 255 RE: octal encoding - wavic - Dec-04-2017 Python 3.6.3 (default, Oct 24 2017, 14:48:20) [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> len('\007') 1 RE: octal encoding - Skaperen - Dec-06-2017 (Dec-04-2017, 09:43 AM)wavic Wrote: '\007' that's the implicit one. i'm asking about the explicit one where you specify that it is octal. and i am asking about what string literals accept, not numeric literals. i thought string literals would accept explicit octal sequences so i included them in my conversion function. i guess i am wrong. i was too confident to RTFM or just test it myself. |