Create a List that contain each Line of a File

前端 未结 8 1520
无人及你
无人及你 2020-12-23 16:52

I\'m trying to open a file and create a list with each line read from the file.

   i=0
   List=[\"\"]
   for Line in inFile:
      List[i]=Line.split(\",\")
         


        
8条回答
  •  鱼传尺愫
    2020-12-23 17:15

    I am not sure about Python but most languages have push/append function for arrays.

提交回复
热议问题