In python, I'm working on doing some work with linecache.getline() to help with reading from a config file (a .txt file). Here is my code:
animation = linecache.getline("config.txt", 2)
print (animation)
if animation == "True":
animation = True
elif animation == "False":
animation = False
else:
config_error(2)
Note: Ignore config_error(2), it's just a function I've made to say something's gone wrong.
My problem is that I'm always being brought to the else statement. As you can see, I've even printed out animation to only find that it print's True. Anyone got any advice or knows what's going wrong?
Aucun commentaire:
Enregistrer un commentaire