I just tried this and it works for me. What does your file look like?
My temp.txt file looked like this:
a
b
with
d
e
and my python file had this code:
print file("temp.txt", "r").read().replace("\n", ", ")
This was my conclusion:
> python temp_read.py
a, b, c, d, e,
source share