繁体   English   中英

TabError:在缩进中使用不一致的制表符和空格

[英]TabError: inconsistent use of tabs and spaces in indentation

文件“F:\\Documents and Settings\\Administrateur\\cracker.py”,第 56 行 if line.startswith('

  • 我的代码:

     if system() == 'Linux': banner() f = open('/tmp/data.txt', 'rU') for line in f: if line.startswith('<li><a') == True: m = re.search(r'(<a href=")(.+[^>])(">)', line) i += 1 local_name = '%s/file%d.txt' % (fout, i) print 'Retrieving...\\t\\t', site + m.group(2) try: urllib.urlretrieve(site + m.group(2), local_name) except IOError: print '\\n[%s] doesn\\'t exist, create it first' % fout sys.exit() if line.startswith('<img') == True: m1 = re.search(r'(<a href=")(.+[^>])(">)', line) i += 1 local_name = '%s/file%d.txt' % (fout, i) print 'Retrieving...\\t\\t', site + m1.group(2) try: urllib.urlretrieve(site + m1.group(2), local_name) except IOError: print '\\n[%s] doesn\\'t exist, create it first' % fout sys.exit()
  • 每使用或者缩进4个空格,或者每一个缩进标签(选项卡每个空格可以在编辑器中最有可能的设置)。 不允许混合使用制表符和空格。 您可以手动修复此问题(通过检查并重新缩进所有内容),或者您的编辑器很可能有一个工具可以为您完成此操作。

    暂无
    暂无

    声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

     
    粤ICP备18138465号  © 2020-2024 STACKOOM.COM