tags:

views:

107

answers:

3

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?

+1  A: 

__file__

It works! Put backticks around the underscores.

Like this:

`__`file`__`
Blorgbeard
+2  A: 

You can also put a backslash before the final underscore

__file_\_

gives you

__file__

Chris Upchurch
A: 

You can use _ in place of left underscores. Example: __file__

J.F. Sebastian