注意:刚开始使用Sublime Text 3在Python中编程。我不知道为什么我在每一行都得到白点/标记,见下图。我想学习以下内容。
你可能安装了Anaconda包。如果是这样,您需要转到首选项→包设置→Anaconda→设置 - 用户。然后粘贴以下代码并保存。那些盒子应该不见了。
{
"anaconda_linting": false,
}
这是由于SublimeLinter安装配置不正确造成的。你可以阅读here,了解如何配置这个非常复杂的插件,以及你安装的任何相关的Python linter。或者,您可以通过选择Preferences → Package Control → Package Control: Disable Package
然后键入sublimelinter
并按Enter键来完全禁用该插件。
如果您感兴趣,那么您将收到错误,因为您的代码不符合PEP8且包含其他一些错误。你需要更多地使用空格:
listone = [1, 2, 3]
listtwo = [1, 2, 3]
matrix_one = [listone, listtwo]
matrix_one = [row[0] for row in matrix_one] # are you sure you really want
# to overwrite your original matrix?
print matrix_one # you had matrix_ones in your original code
如果你刚刚开始学习这门语言,我也强烈建议你使用Python 3。 Stack Overflow Python community压倒性地recommends从Python 3开始,python.org itself也是如此。版本3是语言的现在和未来,而2是过去。首先学习2,你会发现许多坏习惯,当你学习3(你最终需要做)时需要纠正,所以最好从3开始,然后学习2中的差异后来。
我知道这是一个老线程,但看着我没有看到任何好的答案。 linter导致盒子的原因是编程风格差。示例: - 在列表中的逗号或元组linter在行1 2和3中查找“空格”之后。示例第6行:Python正在查找要按下的返回键以创建新行或空格脚本的结尾。示例第6行:python 3打印输出周围的需要括号。
'listone = [1, 2, 3]'
'listtwo = [1, 2, 3]'
'matrix_one = [listone, listtwo]'
'matrix_one = [row[0] for row in matrix_one]'
'print(matrix_one)'
对于Anaconda,请考虑保留错误通知,但要让它们更容易理解。从Sublime文本>首选项>包设置> Anaconda>设置 - 默认编辑
“anaconda_linter_mark_style”:“无”
以下是选项:
/*
If 'outline' (default), anaconda will outline error lines.
If 'fill', anaconda will fill the lines.
If 'solid_underline', anaconda will draw a solid underline below regions.
If 'stippled_underline', anaconda will draw a stippled underline below regions.
If 'squiggly_underline', anaconda will draw a squiggly underline below regions.
If 'none', anaconda will not draw anything on error lines.
*/
转到:Preferences
- > Package Settings
- > SublimeLinter
- > Settings
在none
- > styles
上将值更改为mark_style
如果您安装了anaconda软件包,这将解决问题。
{
"anaconda_linting": false,
}