This is an example excerpt from a bigger code, I have no idea why is this not properly idented
Code example :
if True:
    for i in range(1, 10):
        print(i)
    print("Inside the if")
    print("But outside the loop")
Actual code :
def mkfolder(self):
    path = self.edit_dir.text()
    prefix,fromn,ton,formatn
    if not os.path.isdir(path):
        return self.showerror("Erro de parâmetro", "Caminho para criar as pastas é inválido ou não existe\nCód.: 0052")
    if not self.chk_prefix.isChecked():
        prefix = ""
    else:
        prefix = self.edit_prefix.text()    
    if self.chk_count.isChecked():
        fromn = self.spin_from.getValue()
        ton = self.spin_to.getValue()
        formatn = self.spin_format.getValue()
        if ton <= fromn:
            return self.showerror("Erro de parâmetro", "Não é possível fazer uma contagem regressiva\nCód.: 0010")
        if len(str(abs(ton))) < formatn:
            return self.showerror("Erro de parâmetro", "Quantidade de dígitos é insuficiente\nCód.: 0012")
        strFormat = "{0:0>"+ str(formatn) +"}"
        msg = self.askquestion("Aviso", str(ton - fromn) + " pastas\n Em " + path + "\n De '" + prefix + strFormat.format(fromn) + "'\na '"+ pref+ strFormat.format(ton) +"'\n\nConfirma?")
        if msg==22:
            for i in range(fromn, ton+1):
                os.makedirs(path + "/"+ prefix + strFormat.format(i))           
            self.tomain()
            self.mkclean()
 
     
     
    