what are the differences among the ways to access msvcrt in python on windows?

空扰寡人 提交于 2019-12-11 02:27:39

问题


on windows, what is the difference among the following?

import msvcrt as x

vs

x = ctypes.cdll.msvcrt

vs

x = ctypes.CDLL(find_library('c'))

vs

x = ctypes.CDLL(ctypes.util.find_msvcrt())

i believe the doc say the last two are equivalent. but the first two are never (clearly) documented, and seem strictly better. for instance, when running python from some other context that uses a different msvcr*.dll (eg, matlab), replacing the third with the second solved this bug.

来源:https://stackoverflow.com/questions/30790494/what-are-the-differences-among-the-ways-to-access-msvcrt-in-python-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!