Write a list to a file : Writelines : File PYTHON TUTORIALS


PYTHON TUTORIALS » File » Writelines »

 

Write a list to a file


wordList = ["Red""Blue""Green"]
filePath = "output.txt"

file = open(filePath, 'wU')
file.writelines(wordList)
file.close()



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo File
» Writelines