我转换了一个在python2.7.3中编写的大文件,然后我想升级到python3+(我有3.5)。在
>python 2to3.py -w viterbi.py
来转换到版本3+我有错误的部分
import sys
import numpy as np
import pandas as pd
# Counting number of lines in the text file
lines = 0
buffer = bytearray(2048)
with open(inputFilePatheName) as f:
while f.readinto(buffer) > 0:
lines += buffer.count('\n')
我的错误是:
^{pr2}$这是第一个错误,我无法继续查看是否还有其他错误。我不知道readinto
的等效命令是什么
目前没有回答
相关问题 更多 >
编程相关推荐