Python:哪个命令会增加Windows上打开文件的数量? [英] Python: Which command increases the number of open files on Windows?

查看:51
本文介绍了Python:哪个命令会增加Windows上打开文件的数量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于这个主题似乎有很多问题,我似乎找不到在python脚本中应该确切调用什么来增加打开文件的限制?我知道我需要在C级别上使用_setmaxstdio,但是我不确定如何在python中调用它.有什么想法吗?

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 ?

推荐答案

尝试从 pywin32使用win32file :

import win32file
print win32file._getmaxstdio() #512

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

这篇关于Python:哪个命令会增加Windows上打开文件的数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆