在Python中要将csv文件中的数据读取为字符串,可以使用下面代码。
file=open('name.csv','r')
name=file.read().strip('\n')
file.close()