|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- [code]textFile=open("7.1.txt.txt","rt")
- print(textFile.readline())
- textFile.close()
- binFile=open("7.1.txt.txt","rb")
- print(binFile.readline())
- binFile.close()
复制代码 [/code]
==== RESTART: C:/Users/杜佳欣的电脑/AppData/Local/Programs/Python/Python39/文本文件.py ===
Traceback (most recent call last):
File "C:/Users/杜佳欣的电脑/AppData/Local/Programs/Python/Python39/文本文件.py", line 1, in <module>
textFile=open("7.1.txt.txt","rt")
FileNotFoundError: [Errno 2] No such file or directory: '7.1.txt.txt'
>>>
我命名了一个以“7.1.txt“为文件名的文件想要读取它可是无法运行,系统说找不到这样的文件,为什么啊???
你命名了一个以“7.1.txt“为文件名的文件想要读取它
但是你读取的是7.1.txt.txt文件啊
|
|