1

I pasted some text from a text editor (Atom) into IPython and it was rendered as I saw it on the editor, but some special characters appeared, too. These are light-blue carat capital-i's (^I). They seem to represent indentations. Indeed, when I search through the string by index slices, they show tab characters (\t).

What is this symbol's name? I tried to find it using unicodedata.name('^I'), but it returned a ValueError: no such name error.

If anyone knows where I can find a table of characters by their string representation that will save me a lot of time. The unicode.org source cited in the SO post above does not allow that. Something like this, but with ^I.

Herman Autore
  • 136
  • 2
  • 12
  • 2
    That seems like [caret notation](https://en.wikipedia.org/wiki/Caret_notation). Python does not use those. This is likely added (and hidden) by your editor. – MisterMiyagi Jan 28 '21 at 18:58
  • 1
    `^I` seems like an encoding issue. For example, if you open a "Windows" formatted file, you may see `^M` instead of the newlines. – gen_Eric Jan 28 '21 at 18:58
  • 1
    Apparently, `^I` is a "tab" character. See: https://superuser.com/questions/301345/what-is-the-i-character-and-how-do-i-find-it-with-sed – gen_Eric Jan 28 '21 at 19:00
  • 1
    ``^I`` is the same as ``\t``: [9 (horizontal tab, HT, \t, ^I)](https://en.wikipedia.org/wiki/Control_character) – MisterMiyagi Jan 28 '21 at 19:00
  • Those are great answers. I especially enjoyed this Wikipedia article: https://en.wikipedia.org/wiki/Tab_key#Tab_characters. If you post any of your comments as answers I will accept them. – Herman Autore Jan 28 '21 at 19:17

0 Answers0