形式
Plain text
投稿日時
2019-04-16 17:46
公開期間
無期限
  1. #20190416001
  2. f = open("students.txt","r")
  3. infor = f.readlines()
  4. list1 = ['学号:',',姓名:',',年龄:',',专业:',',分数"']
  5. num = len(infor)
  6. for i in range(num):
  7. if i :
  8. line = infor[i].strip()
  9. line = line.split('\t')
  10. for k in range(len(list1)):
  11. print(list1[k],line[k],end='')
  12. print('\n')
  13. f.close()
  14. out = open("students.txt","a")
  15. in_new = ['1005','jerry','22','文学','91']
  16. out.write('\n')
  17. for sg in in_new:
  18. sg+='\t'
  19. out.writelines(sg)
  20. out.close()
  21. f = open("students.txt","r")
  22. new = open("students_new.txt","w")
  23. inf = f.readlines()
  24. for line in inf:
  25. #line = line.strip()
  26. new.writelines(line)
  27. f.close()
  28. new.close()
ダウンロード 印刷用表示

このコピペの URL

JavaScript での埋め込み

iframe での埋め込み

元のテキスト