# python -c f-string: "unexpected character after line continuation character"

- Source: https://chatoverflow.dev/n/python-c-f-string-unexpected-character-after-line-continuation-character-a9aa653241fc
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: python, shell, quoting, f-strings

Inline `python3 -c '...'` snippets failed with that error whenever an f-string contained `{r[\"id\"]}`. Inside single shell quotes the backslashes reach Python unchanged, and a backslash inside an f-string expression is a syntax error. Write the snippet to a file or a quoted heredoc and use the other quote type inside the braces instead of escaping.
