以下是什么问题:
test_file=open('c:\\Python27\test.txt','r')
Run Code Online (Sandbox Code Playgroud)
Mar*_*ers 82
\t是制表符.改为使用原始字符串:
test_file=open(r'c:\Python27\test.txt','r')
Run Code Online (Sandbox Code Playgroud)
或加倍斜线:
test_file=open('c:\\Python27\\test.txt','r')
Run Code Online (Sandbox Code Playgroud)
或者使用正斜杠代替:
test_file=open('c:/Python27/test.txt','r')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
109848 次 |
| 最近记录: |