IndentationError unindent与任何外部缩进级别都不匹配

时间:2019-05-23 09:13:05

标签: python-3.x

  File "actions2.py", line 527
    if path.exists('Server/www/index.html'):
                                           ^
IndentationError: unindent does not match any outer indentation level

我一直收到该错误,在这里我的脚本顺便说一句,香港专业教育学院尝试了很多事情仍然一直收到此错误,请帮助我即时死亡

def instagrambar():# It puts instagram (instagram.png) file name in inception-bar script we added in index page
                system("cp WebPages/INCEPTION-BAR/instagram.png /Server/www/ && cp WebPages/INCEPTION-BAR/background-bar.png /Serve$
        if path.exists('Server/www/index.html'):
         with open('Server/www/index.html') as f:
             read_data = f.read()
         c = read_data.replace('''<INCEPTION>''', '''instagram''')
         f = open('Server/www/index.html', 'w')
         f.write(c)
         f.close()
         print(_("\n{0}[{1}#{0}]INSTAGRAM INCEPTION-BAR{0} ADDED !!!").format(RED, DEFAULT)) 
         sleep(2)

1 个答案:

答案 0 :(得分:1)

尝试一下:您已为函数内的数据提供了额外的标签

def instagrambar():# It puts instagram (instagram.png) file name in inception-bar script we added in index page
    system("cp WebPages/INCEPTION-BAR/instagram.png /Server/www/ && cp WebPages/INCEPTION-BAR/background-bar.png /Serve$")
    if path.exists('Server/www/index.html'):
        with open('Server/www/index.html') as f:
            read_data = f.read()
        c = read_data.replace('''<INCEPTION>''', '''instagram''')
        f = open('Server/www/index.html', 'w')
        f.write(c)
        f.close()
        print(_("\n{0}[{1}#{0}]INSTAGRAM INCEPTION-BAR{0} ADDED !!!").format(RED, DEFAULT)) 
        sleep(2)