以下是什么问题:
test_file=open('c:\\Python27\test.txt','r')
\t是制表符。请使用原始字符串:
\t
test_file=open(r'c:\Python27\test.txt','r')
或将斜杠加倍:
test_file=open('c:\\Python27\\test.txt','r')
或改用正斜杠:
test_file=open('c:/Python27/test.txt','r')