【问题标题】:IndentationError unindent doesnt match any outer indentation levelIndentationError unindent 不匹配任何外部缩进级别
【发布时间】:2019-05-23 17:52:26
【问题描述】:
  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)

【问题讨论】:

    标签: python-3.x


    【解决方案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)
    

    【讨论】:

    • 文件“actions2.py”,第 557 行 else: ^ IndentationError: unindent 不匹配任何外部缩进级别
    • 文件“actions2.py”,第 557 行 else: ^ IndentationError: unindent 不匹配任何外部缩进级别
    • 代码??????您在兄弟中遇到错误的代码在哪里。如果我不知道问题出在哪里,我帮不了你,所以请分享一段代码
    • 在此处粘贴您的代码textb.org/t/rocky 完整代码我的意思是完整的功能
    • 我去检查了
    猜你喜欢
    • 2010-10-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多