Wondering how to write unreadable ^A into a file using Python. For unreadable ^A, I mean when we use command "set list" in vi, we can see unreadable character like ^I for '\\t', $ for '\\n'.
thanks in advance, Lin
If you know the character code, you can output it using the chr()
function. For example:
>>> chr(97)
'a'
Do you mean the Start of Header character?
If so, then use this:
chr(1)
Another way to do it is '\\1'. Cheers!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.