Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Use file pointer to get file content : File Pointer « File « Python






Use file pointer to get file content


f = open('somefile.txt', 'w')
print >> f, 'This is the first line'
print >> f, 'This is the second line'
print >> f, 'This is the third line'
f.close()

           
       








Related examples in the same category