在数组中循环并用逗号python拆分

2024-06-08 22:03:05 发布

您现在位置:Python中文网/ 问答频道 /正文

#target_filename

base_source_dir = 'C:\\SourceFiles\\'
base_target_dir = 'C:\\TargetFiles\\'


###read the filename_convention.txt file and put it into an array'
parserlines = [line.strip().split(",") for line in open("C:\\Python34\\filename_convention.txt", 'r')]


parserarray = 'loop through each line from the array parserlines and split by comma'
   # account for the headerline

好的,我有一个文件,列表基本上是这样的

^{pr2}$

我想读一行【】然后能得到每个人的名字。在

我是python新手,所以任何帮助都是非常感谢的!在


Tags: andthetxtsourcetargetforbasedir