使用绝对路径
print(open(‘D:\python\test\test1\pi_digits.txt’).read().rstrip())
print(open(r’D:\python\test\test1\pi_digits.txt’).read().rstrip())
print(open(‘D:/python/test/test1/pi_digits.txt’).read().rstrip())
使用相对路径,py文件在test,pi_digits.txt在test1下,test\test1
print(open(‘test1\pi_digits.txt’).read().rstrip())
OSError: [Errno 22] Invalid argument:的错误
最新推荐文章于 2024-04-09 02:02:43 发布