1. #!/usr/bin/python 
  2. #2011/09/18 by larry 
  3.  
  4. Success=['larry','ldh','wyy'] 
  5. for i in Success: 
  6.         Mailcontents=''
  7. Dear %s: 
  8.         you have been accepted as a linux system administrator and you can come to work next work. 
  9.                                                 by boss 
  10.                                                 2011/09/18 
  11.                                                 ''' % i 
  12.         f=file(i,'w') 
  13.         f.write(Mailcontents) 
  14.         f.close() 

 

 
  
  1. #!/usr/bin/python 
  2. #2011/09/18 by larry 
  3. f=file('larry') 
  4. while True: 
  5.         line=f.readline() 
  6.         if len(line)==0: 
  7.                 break 
  8.         else: 
  9.                 print line 
  10. f.close