我想将tab转换为gVim中的空格.我向我添加了以下行_vimrc:
set tabstop=2
Run Code Online (Sandbox Code Playgroud)
它可以在两个空格处停止,但它仍然看起来像是插入了一个tab键(我尝试使用h键来计算空格).
我不知道如何将gVim转换为空格?
我有一个Python脚本:
if True:
if False:
print('foo')
print('bar')
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试运行我的脚本时,Python提出了一个IndentationError:
File "script.py", line 4
print('bar')
^
IndentationError: unindent does not match any outer indentation level
Run Code Online (Sandbox Code Playgroud)
我一直在玩我的程序,我还能够产生其他三个错误:
IndentationError: unexpected indentIndentationError: expected an indented blockTabError: inconsistent use of tabs and spaces in indentation这些错误意味着什么?我究竟做错了什么?我该如何修复我的代码?
我的python文件的一个示例是
def __init__(self, csvFile, chunksize=10000):
self.newName = csvFile[:-4]
import ipdb; ipdb.set_trace()
self.csvFile=csvFile
self.chunksize=int(chunksize)
self.headers_without_timestamp = header_without_timestamp
self.total_rows = 0
self.username=username
self.password=password
self.dbname="data"
Run Code Online (Sandbox Code Playgroud)
而且写得很好.
我有一个小错误,但我无法解决它.当我运行命令时python3 Final_Fast_Version_Waqar.py ~/home/Data/DCIX_OB.csv 1000 7,我得到了
File "Final_Fast_Version_Waqar.py", line 37
import ipdb; ipdb.set_trace()
^
TabError: inconsistent use of tabs and spaces in indentation
Run Code Online (Sandbox Code Playgroud)
这是一个与vim编辑器相关的问题,我猜是因为我最近设置了一个Ubuntu服务器并安装了vim.如何修复缩进错误?