2024-09-30 03:23:39 发布
网友
我从一个txt文件的行中获取了一个数组。问题是我只需要这些线的末端。我对Python还很陌生,所以我不知道如何将这些概念组合起来。下面是我最好的尝试,第一部分工作,但第二部分崩溃。你知道吗
with open("prices.txt") as f: readline = f.readlines() for seatCapacity in readline: seatCapacity = readline[10:]
我想,你想要这样。你知道吗
with open("prices.txt") as f: for line in f: seatCapacity = line[10:]
您可以参考以下解决方案:How should I read a file line-by-line in Python?
我想,你想要这样。你知道吗
您可以参考以下解决方案:How should I read a file line-by-line in Python?
相关问题 更多 >
编程相关推荐