举个例子:numpy = []with open("linshi.txt", "r") as f:data = f.readlines()a = [1, 3, 5, 7, 9]for i in a:x = data[i-1]numpy.append(x)print(numpy)
先放到列表里:
i = [1, 3, 5, 7, 9, 2, 4, 6, 8, 11, 15]numpy = i[5:8]
这样应该就可以了
不行再找我