我确实有一个关于标记编号列表的快速问题。
基本上,我想写的东西是:
1) Idea 1
2) Idea 2
''' Some txt '''
3) Idea 3
4) Idea 4
''' Or some other text '''
3) Other Idea 3
4) Other Idea 4
我发现两个文本之前的4个空格允许数字继续,但是,我无法找到第二次重新启动列表的方法。
如果有人已经面临这个问题,我很高兴听到这个解决方案。我正在开发PyCharm,它是一个在GitHub上容易阅
使用PHP,我希望从包含编号列表的字符串中提取数组。
示例字符串:
The main points are: 1. This is point one. 2. This is point two. 3. This is point three.
将产生以下数组:
[0] => 1. This is point one.
[1] => 2. This is point two.
[2] => 3. This is point three.
字符串的格式可以不同,例如:
1. This is point one, 2. This is point two, 3. This is
我试着为学生创建一个教程。我想给我问的问题编号,但在中间我想添加一些信息来介绍这些问题。如何制作一个自动编号的列表,而不重置每次输入文本的编号。例如:
This is some info.
1. This is question one.
This is more info.
2. This is question two.
给出输出:
这是一些信息。
这是第一个问题。
这是更多的信息。
这是第二个问题。
假设我有一个2D Numpy数组:
>>> a = np.random.random((4,6))
我想在每一行中添加一个一维数组:
>>> c = np.random.random((6,))
>>> a + c
这是可行的。现在,如果我尝试向每一列添加一个一维数组,我会得到一个错误:
>>> b = np.random.random((4,))
>>> a + b
Traceback (most recent call last):
File "<stdin>", li
我一直试图创建如下所示的嵌套列表(带有kramdown,用于GitHub页面),但是HTML并不是语义性的;第2层列表使用段落而不是列表元素,第3层列表项使用代码块。
1. Do something.
2. Do something else.
a. If the reverse-Pi separation gauge is set to `OFF` you can follow
the following procedure.
i. Use the flux capacitor on Mondays, Tuesdays and Thursdays,
我希望能够拆分以下字符串:
"This is a string with an embedded list. 1. My first list item. 2. My second item. a. My first sub-item. b. My second sub-item. 3. My last list item."
我想把它分成两部分:
"This is a string with an embedded list."
"1. My first list item."
"2. My second item."
我正在创建一个编号列表,我想在列表中插入一段原来的“顶级”文本,而不是编号。我通过以下问题了解了如何做到这一点:
但是,这确实很难看,因为文本比列表项缩进的更多。如何使文本不缩进,即在正常的段落缩进?例如:
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod.
#:
#: Now for the final steps:
#:
# step t
这将使用额外的缩进来表示"Now for the final steps:",如下所示:
1. Lorem ipsum dolor si