Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 750
readonly Avatar asked Sep 09 '08 22:09

readonly


2 Answers

__file__

Put a backslash before the first underscore.

Like this:

\__file__ 
like image 100
Blorgbeard Avatar answered Sep 24 '22 02:09

Blorgbeard


You can also put a backslash before the final underscore

__file_\_ 

gives you

__file__

like image 36
Chris Upchurch Avatar answered Sep 20 '22 02:09

Chris Upchurch