如何在 Markdown 中显示双下划线?
在Python中,有一些特殊的变量和文件名是用双下划线包围的。 例如,有一个
__file__
变量。 我只能让它们在代码块内正确显示。 我需要输入什么才能在常规文本中获得双下划线而不将其解释为强调?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
这看起来更好,因为它不会使文本斜体。
This seems better as it won't italicize the the text.
`*
` 这同样适用于星号字符或任何 Markdown 语法。 Bbackticking 效果很好。`*
` The same holds true for the star-character or any markdown syntax. Bbackticking works well._\_文件__
输入这个会对你有帮助。
_\_file__
enter this will help you.
您可以使用
_
代替左下划线。 例子:__文件__
You can use
_
in place of left underscores. Example:__file__
只需要在markdown中这样写即可
Just you need to write it like this in markdown
在第一个和第二个下划线之前添加一个反斜杠,例如:
它会显示如下:
只有一个反斜杠是不够的,因为它会使您的文本以斜体显示。
顺便说一句,考虑到它们是变量和文件名,我建议将其括在反引号(`)中:
它将显示为
__main.py__
。Put a backslash before the first and the second underscore, like:
It will show like this:
Only one backslash is not enough, because it will make your text shown in Italic.
By the way, considering they are variables and filenames, I suggest enclosing it in backticks(`):
It will show like
__main.py__
.您还可以在最后一个下划线之前添加反斜杠
给您
__file__
You can also put a backslash before the final underscore
gives you
__file__
__file__
在第一个下划线之前放置一个反斜杠。
像这样:
__file__
Put a backslash before the first underscore.
Like this: