Opening and writing to a file. : Write : File PYTHON TUTORIALS


PYTHON TUTORIALS » File » Write »

 

Opening and writing to a file.


import sys

try:
   file = open"clients.dat""w" )  
except IOError, message:              
   print >> sys.stderr, "File could not be opened:", message
   sys.exit)

print >> file, "account"
      
file.close()



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo File
» Write