我正在尝试访问Python中的.txt文件,我无法弄清楚如何打开文件.我最终直接将内容复制到列表中,但我想知道如何打开未来的文件.
如果我跑这个没什么打印.我认为这是因为Python正在查找错误的文件夹/目录,但我不知道如何更改文件路径.
sourcefile = open("CompletedDirectory.txt").read() print(sourcefile)
python python-3.x
python ×1
python-3.x ×1