Search code examples
markdown

How do you get double-underscores to display in markdown?


In python, there are some special variables and filenames that are surrounded by double-underscores. For example, there is the

__file__ 

variable. I am only able to get them to show up correctly inside of a code block. What do I need to enter to get double underscores in regular text without having them interpreted as an emphasis?


Solution

  • __file__

    Put a backslash before the first underscore.

    Like this:

    \__file__