简体   繁体   English

Python CTYPE找不到DLL?

[英]Python ctype can't find dll?

Python ctype can't find AntTweakBar.dll ?? Python ctype找不到AntTweakBar.dll ?? and the file dosn't exist for python OS file system call, but exists in the c:\\Windows\\System32 dir. 并且该文件对于python OS文件系统调用不存在,但存在于c:\\ Windows \\ System32目录中。

C:\Users\dkm>dir c:\Windows\System32\ant*dll
 Volume in drive C is Windows 7
 Volume Serial Number is FC61-5FBB

 Directory of c:\Windows\System32

23/07/2012  12:05 AM           641,536 AntTweakBar.dll
22/07/2012  11:43 PM           774,144 AntTweakBar64.dll
               2 File(s)      1,415,680 bytes
               0 Dir(s)  47,418,232,832 bytes free

C:\Users\dkm>python
Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes.util import find_library
>>> import os
>>> print os.path.exists('C:\\Windows\\System32\\antweakbar.dll')
False
>>> find_library("AntTweakBar")
>>>

why can't ctype find the dll? 为什么ctype无法找到dll?

there are 2 t's in the file name 文件名中有2 t

antweakbar.dll - name given by you antweakbar.dll您提供的名称

AntTweakBar.dll - actual file name AntTweakBar.dll实际文件名

C:\\\\Windows\\\\System32\\\\antweakbar.dll should be C:\\\\Windows\\\\System32\\\\anttweakbar.dll C:\\\\Windows\\\\System32\\\\antweakbar.dll应该是C:\\\\Windows\\\\System32\\\\anttweakbar.dll

for example (checking with inetcfg.dll, as i don't have anttweakbar.dll), see below for Python 2.7.2 例如(检查inetcfg.dll,因为我没有anttweakbar.dll),请参见下面的Python 2.7.2

In [136]: import os

In [137]: os.path.exists("C:\\Windows\\System32\\inetcfg.dll")
Out[137]: True

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM