输入文件:
1
2
3
4
5
我此时拥有的:
filename=input("Please enter the filename or path: ")
with open(filename, 'r') as file:
filecontents=tuple(map(int, file.read().split()))
print(filecontents)
输出:(1,2,3,4,5)
预期输出:
1
2
3
4
5
输入文件:
1
2
3
4
5
我此时拥有的:
filename=input("Please enter the filename or path: ")
with open(filename, 'r') as file:
filecontents=tuple(map(int, file.read().split()))
print(filecontents)
输出:(1,2,3,4,5)
预期输出:
1
2
3
4
5