如果代码中有制表符,会发生什么情况?
可将制表符转换成空格的选项。
清单11展示如何使用tr将空格转换为制表符。
d——允许我们指定其他分隔符,而不是制表符。
有时候,您可能希望将制表符替换为空格,或者相反。
Sometimes you may want to swap tabs for Spaces or vice versa.
可以使用制表符来标记缩进,但是一般推荐使用空格。
You can use tab characters to mark the indentation, but it's generally recommended that you use spaces.
设置一个单一值,它将以此为间隔设置重复的制表符。
如果断言为真,则可以用制表符(\t)替换逗号。
If the assertion is true, the comma may be replaced with a TAB (the \ t).
其中一些选项控制它输出非打印字符的方式,例如制表符和控制字符。
Some of them control the way it outputs nonprinting characters, such as tabs and control characters.
其他格式包括名称-值对格式、制表符分隔的格式以及固定宽度的格式。
Others formats include name and value pairs, tab-separated, and fixed-width formats.
回忆一下,我们前面使用tr命令将text1中的空格修改为制表符。
Remember earlier we used the tr command to change blanks in text1 to tabs.
cat的- a选项提供了另一种方法来查看制表符和行结束符的位置。
The -a option of cat provides an alternate way of seeing where your tabs and line endings are.
也可处理以空格、分号、制表符、回车或任何其他可识别字符分隔的列表。
A list separated by Spaces, semicolons, tabs, carriage returns, or any other identifiable character can be processed.
除非您指定了一个不同的字段分隔符,否则将使用空格或制表符分隔字段。
Unless you specify a different field separator, fields are delimited by blanks or tabs.
但您不知道单词由什么分隔,是空格、换行符、制表符还是这些字符的组合。
But you don't know whether the words are separated by Spaces, line breaks, tabs, or some combination of these.
默认的分隔符是制表符,- f选项可以用来指定希望显示的域。
The default delimiter is the TAB, and the -f option is used to specify the desired field.
cat还可以在您查看包含如制表符这样的非打印字符的文件时起帮助作用。
Cat can also help when you are viewing files that contain non-printing character like tabs. You can reveal them with these options.
否则其他补全将不可行,因此它通过返回一个制表符来充当正常的tab键。
Otherwise, no completion was possible, so it falls back to acting like a normal TAB key, by returning a literal TAB character.
在创建text1和text2文件时,我们使用制表符创建了text2。
When we created our text1 and text2 files, we created text2 with TAB characters.
这种方法删除代码中所有不必要的字符,比如制表符(tab)、新行和空格。
Minification removes from the code all the unnecessary characters, such as tabs, newlines, and Spaces.
要通过文本文件向数据库填入数据,需要创建一个以制表符定界的文件。
To populate tables in your database from a text file, you need to create a TAB delimited file.
制表符字符是默认的分隔符,但是我们可以使用- d选项将其修改成任何其他值。
The TAB character is the default delimiter, but you can change it to anything else with the -d option.
修正混合制表符——会提示开发人员修正混合了制表符和空格的代码文件。
Fix Mixed tabs - Prompts to fix files that mix tabs and Spaces.
约定的可读性目标包括使用断行、将空格当做制表符和空白对待,以及条件语句的格式。
Conventions aimed at readability includes such things as the use of line breaks, treatment of whitespace like tabs and Spaces, and the formatting of conditional statements.
我们曾经在清单9中创建了一个强制制表符,您可以从中看到命令替换的例子。
You saw an example of command substitution in Listing 9 when we created a captive TAB character.
接下来的符号表示任意数量的空格、换行或制表符(\s),但至少要有一个(+)。
What follows indicates any number of Spaces, new lines, or tabs (\ s), but at least one (+).
在图3中,用红色高亮显示repeat后面的制表符;这明确地警告用户这里有错误。
In Figure 3, the TAB just after repeat is highlighted in red; a clear flag to the user that something is wrong.
在此之后,如果在一行的开头输入空格或制表符,那么后续的新行将会缩进到相同的位置。
From this point on, if you use leading spaces or tabs in a line, subsequent new lines will be indented to the same place.
现在,我们没有必要调用cat,而是使用输入重定向将空格转换成制表符,如清单7所示。
Instead of needlessly calling cat, we can now use input redirection to translate the Spaces to tabs, as shown in Listing 7.
第一组选项可以改变Py Dev在源代码中处理制表符的方式,还可以改变语法元素的颜色。
The first set of preferences lets you change Settings on how PyDev treats tabs within source code, and to change syntax coloring.
应用推荐