我构建了一个python文档生成器-sphinx,当我用firefox单击第11篇文章http://127.0.0.1/build/html/python/Using%20iloc,%20loc,%20&%20ix%20to%20select%20rows%20and%20columns%20in%20Pandas%20DataFrames.html
时,放一些文章,如下所示:
然后单击目录:12.What does "_" in python mean in a for-loop
,Firefox跳入http://127.0.0.1/build/html/python/What%20does%20%22_%22%20in%20Python%20mean%20in%20a%20for-loop?.html
,如下所示:
事实上,网页What does "_" in Python mean in a for-loop?.html
位于目录build/html/python
中。
ls build/html/python | grep What
What does "_" in Python mean in a for-loop?.html
如果我手动输入网址,则>
http://127.0.0.1/build/html/python/What%20does%20%22_%22%20in%20Python%20mean%20in%20a%20for-loop%3f.html
为什么
http://127.0.0.1/build/html/python/What%20does%20%22_%22%20in%20Python%20mean%20in%20a%20for-loop?.html
无法解析为
http://127.0.0.1/build/html/python/What%20does%20%22_%22%20in%20Python%20mean%20in%20a%20for-loop%3f.html
通过sphinx系统何时单击目录?是否是狮身人面像的错误?如何解决?
第一个文件
What does "_" in Python mean in a for-loop? ================================================= It’s generally an indication that you don’t care about the current value of the variable. For example, you might have: for i in range (1, 11): print(i) In the case above, we clearly want to use i in our code. However, in the following case: for i in range (1, 11): print(“Hello”) The i is not used. We indicate this by using _ instead: for _ in range (1, 11): print(“Hello”) This is not required; it is just idiomatic. It is also useful while debugging, as you know that you didn’t use _ anywhere in the loop. While this: for _ in range (1, 11): print(_) will work just as it did with i, it is bad practice at best and can be extremely confusing in more complex examples.
以上第一个文件在
make html
之后的html文件部分。
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>12. What does “_” in Python mean in a for-loop? — documents 1 documentation</title> <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/language_data.js"></script> <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="13. install opencv on debian" href="install opencv on debian.html" /> <link rel="prev" title="11. Using iloc, loc, & ix to select rows and columns in Pandas DataFrames" href="Using iloc, loc, & ix to select rows and columns in Pandas DataFrames.html" /> <link rel="stylesheet" href="../_static/custom.css" type="text/css" /> <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" /> </head>
如果我将源文件名
What does "_" in Python mean in a for-loop?.rst
更改为What does "_" in Python mean in a for-loop.rst
,也就是说,在第一个文件名中删除?
,则单击目录将跳至http://127.0.0.1/build/html/python/What%20does%20%22_%22%20in%20Python%20mean%20in%20a%20for-loop.html
,What does "_" in Python mean in a for-loop.rst
中的内容显示完美,为什么文件名不能包含?
,例如What does "_" in Python mean in a for-loop?.rst
。为什么第一个文件名中不能包含?
?如askaroni所说,与代码块指令无关。
[我构建了一个python文档生成器-sphinx,当我单击第11篇文章http://127.0.0.1/build/html/python/Using%20iloc,%20loc,%20&%20ix%时,在其中添加一些文章20to%20select%20rows%20and%...
尝试使用代码块指令。