简体   繁体   中英

TabError: inconsistent use of tabs and spaces in indentation

File "F:\\Documents and Settings\\Administrateur\\cracker.py", line 56 if line.startswith('

  • My codes :

     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()
  • Use either 4 spaces per indention, or one tab per indention (spaces per tabs can be set in your editor most likely). Mixing tabs and spaces is not allowed. You can fix this by hand (by going through and re-indenting everything) or your editor most likely has a tool that will do this for you.

    The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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