Joel Ross wrote:
Hi all,
I have this piece of code:
#########################################################################
wordList = "/tmp/Wordlist"
file = open(wordList, 'r+b')
def readLines():
for line in file.read():
if not line: break
print line + '.com '
return line
readLines()
file.close()
##########################################################################
It returns the results:
t.com
NOTE: Only returns the first letter of the first word on the first line
e.g. test would only print t and readline() does the same thing.
I have also tried readlines() which gives me the result:
test
.com
The file Wordlist has one word on each line for example
test
test1
test2
I need it to loop though the Wordlist file and print/return the results
test.com
test1.com
test2.com
I'm just looking for a point in the right direction.
Much Thanks
JOelC
Thanks for the quick response guys. Help me out a alot. I'm a newbie to
python and your replies help me understand a bit more about python!!
Thank You
--
http://mail.python.org/mailman/listinfo/python-list