<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16788" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>can someone help me please </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#open file and read last names<BR>filename =
input('name file')<BR>file = open(filename, 'r')<BR>names_list =
file.readlines()<BR>file.close()<BR>#open a file for saving
passwords<BR>outfile_name = input('Save passwords')<BR>outfile =
open(outfile_name, 'a')</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>#create a password for each name in list<BR>import random,
string<BR>name = ('')<BR>for name in names_list:<BR>
name_prefix = name[0:2]<BR> number =
random.randrange(100,999)<BR> name_prefix =
str.upper(name_prefix)<BR> password = name_prefix +
str(number)<BR> whole_line = (password)<BR>
print (password)<BR>
outfile_name.write(whole_line)<BR>
outfile_name.close()<BR> <BR> print
(password)</DIV>
<DIV> </DIV>
<DIV><FONT color=#ff0000>error</FONT></DIV>
<DIV><FONT color=#ff0000>Traceback (most recent call last):<BR> File
"C:\Documents and Settings\Gary\Desktop\python\bembry\pa2.i.py", line 21, in
<module><BR>
outfile_name.write(whole_line)<BR>AttributeError: 'str' object has no attribute
'write'</FONT></FONT></DIV></BODY></HTML>