打開一個文本文件,這似乎是它應該是很容易的:問題在Python
f = open('C:\Users\john\Desktop\text.txt', 'r')
但我收到此錯誤:
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
f = open('C:\Users\john\Desktop\text.txt', 'r')
IOError: [Errno 22] invalid mode ('r') or filename: 'C:\\Users\robejohn\\Desktop\text.txt'
有什麼想法?