Python: Which command increases the number of open

2020-07-26 12:13发布

问题:

There seems to be lots of questions on this topic bit I can't seem to find what exactly I should call inside my python script to increase the open file limit ? I know that I need to use the _setmaxstdio on C level but I am not sure how to call it in python. Any ideas ?

回答1:

Try to use win32file from pywin32:

import win32file
print win32file._getmaxstdio() #512

win32file._setmaxstdio(1024)
print win32file._getmaxstdio() #1024


标签: python file io