How to fix 'if bool' statement from an read file def : <p>So I try to make an app to help a friend on day by day job and I created a settings and language to be more easy to change around some app properties and both of them have same idea of reading some text file but one is work and other one not :(</p>

<p>I tried to delete tabs title translations and is work, but when I place them back the language.py will not want to work.</p>

<p>Reading the language file is not working</p>

<pre class="lang-py prettyprint-override"><code>#// Try to read language file
langf = "asi_lang_"
lange = ".kmc"

app_title       = ""
tab_dimensions  = ""
tab_materials   = ""
tab_settings    = ""

def readFileLanguage(langName):
    global app_title, tab_dimensions, tab_materials, tab_settings

    file = fr"res\lang\{langf}{langName}{lange}"
    try:
        with open(file, mode="r", encoding="utf-8") as r:
            l = r.readline()

            while l:
                if "=" in l:
                    x = l.split("=")
                    data=x[0]; info=x[1]
                    if "\n" in info:
                        info = info.replace("\n", "")

                    if data == "app_title":
                        app_title = info
                        l = r.readline()
                    elif data == "tab_dimensions":
                        tab_dimensions = info
                        l = r.readable()
                    elif data == "tab_materials":
                        tab_materials = info
                        l = r.readable()
                    elif data == "tab_settings":
                        tab_settings = info
                        l = r.readable()

                    else:
                        l = r.readline()
                else:
                    l = r.readline()
    finally:
        r.close()
</code></pre>

<p>The language file (asi_lang_ro.kmc) is look like this:</p>

<pre><code>#// KmcASI language file

app_title=Testare App

#// If I delete this lines will work but I need them
tab_dimensions=Dimensiuni
tab_materials=Materiale
tab_settings=Setari

#// End file
</code></pre>

<p>Console output:</p>

<pre><code>Traceback (most recent call last):
  File "C:/Users/Andrei/PycharmProjects/Testing/main.py", line 10, in &lt;module&gt;
    readFileLanguage(app_language)
  File "C:\Users\Andrei\PycharmProjects\Testing\res\lib\language.py", line 19, in readFileLanguage
    if "=" in l:
TypeError: argument of type 'bool' is not iterable
</code></pre>

<p>I will expected some tabs to get the names from language file. If I delete them will work but will not show any text on that tabs.</p>
