Change all text in file to lowercase
<pre><code>from itertools import chain
from glob import glob

file = open('FortInventory.txt','w')

lines = [line.lower() for line in lines]
with open('FortInventory.txt', 'w') as out:
     out.writelines(sorted(lines))
</code></pre>

<p>I am trying to convert all text in a txt file to lowercase how would i go about doing this, here is the code i have so far and i looked at some questions on stack overflow but i couldnt quite figure it out, if anyone could link me to the right article or tell me what is wrong with my code i would greatly appreciate it.</p>