|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
Traceback (most recent call last):
File "C:\genesis\sys\scripts\example\example.py", line 16, in <module>
import genClasses
File "D:\Python34\lib\genClasses.py", line 285
def clean(self,strip_me,badchars):
^
TabError: inconsistent use of tabs and spaces in indentation
老是报错(上),我查了N遍,就是找不到问题。下面是原文:
def clean(self,strip_me,badchars):
""" Internal - strips a string (strip_me) of given (badchars) on either edge - used in parsing"""
badchars = badchars + ' \n'
l = len(strip_me)
if l < 1:
return ""
while(len(strip_me) > 0):
if strip_me[0] in badchars:
strip_me = strip_me[1:]
else:
break
x = len(strip_me)-1
for i in range(x):
if strip_me[x-i] in badchars:
strip_me = strip_me[:x-i]
else:
break
return strip_me
|
|