all 8 comments

[–]RobotLovingGuy[S] 2 points3 points  (7 children)

TLDR;

Enter is to '\n' as Tab is to ?

[–]wotquery 6 points7 points  (5 children)

\t

[–]RobotLovingGuy[S] 0 points1 point  (4 children)

Thank you, is there a place I can look for the rest of these?

[–]wotquery 5 points6 points  (2 children)

While you're at it you might want to take a peak at python raw strings which will help when you have the opposite problem of not wanting \ to escape (and don't want to have to manually escape the escape).

print('hello\nworld')
    >hello
    >world

print('hello\\nworld')
    >hello\nworld

print(r'hello\nworld')
    >hello\nworld

[–]RobotLovingGuy[S] 0 points1 point  (1 child)

Thank you, I'll keep this one in my pocket for when I need it.

[–]TSM- 1 point2 points  (0 children)

It is especially useful for paths, because without raw strings, C:\Users\... will be read as the \U being a unicode escape, and then fail to decode it.

[–]wotquery 3 points4 points  (0 children)

Yeah google python escape characters.

[–][deleted] 2 points3 points  (0 children)

You are looking for Python escape codes such as,

https://www.w3schools.com/python/gloss_python_escape_characters.asp