I have this code:
import itertools
res = itertools.permutations('abcdefghijklmnopqrstuvwxyz',5) # 5 is the length of the result. 
for i in res: 
   print ''.join(i)
I need the result in stead of being printed print ''.join(i) to be saved in a .txt file.
I am not familiar with python. Thank you for your time!