I want to read from the pList.csv
file and write all item in a string, such that each row is separated by a comma.
the file has only one column. for example, the pList.csv
is :
28469977
24446384
25968054
and output string must be:
28469977,24446384,25968054
for do this, have considered the following code. but there is a little problem
p_list = ""
with open("pList.csv", mode="r") as infile:
reader = csv.reader(infile)
for row in reader:
p_list += row[0]
if its_not_last_loop :
p_list += ","
What expression is appropriate for its_not_last_loop
so that ,
is not applied to the last row of the file?