문제

나는 현재 Python이있는 DLL에서 내성을 만들려고 노력하고 있습니다. DLL을 기반으로 그래픽 테스트 인터페이스를 자동으로 만들고 싶습니다.

DLL을 Python에 아주 쉽게로드 할 수 있으며 일부 기능을 호출합니다. 주요 문제는 다른 방법을 호출하지 않고 객체에서 "dir"호출하는 경우 결과를 얻었습니다.

>>> dir(myLib)
['_FuncPtr', '__class__', '__delattr__', '__dict__', '__doc__',
'__format__', '__getattr__', '__getattribute__', '__getitem__', '__hash__', '__i
nit__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__s
etattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_func_fl
ags_', '_func_restype_', '_handle', '_name']

그리고 수동으로 함수를 호출 할 때 ( "read_version"과 같은) DIR 함수의 결과로

>>> dir(myLib)
['Read_Version', '_FuncPtr', '__class__', '__delattr__', '__dict__', '__doc__',
'__format__', '__getattr__', '__getattribute__', '__getitem__', '__hash__', '__i
nit__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__s
etattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_func_fl
ags_', '_func_restype_', '_handle', '_name']

내성은 내가 이미 호출 한 기능에서만 작동하는 것 같습니다. 이것은 실제로 "유용한"것이 아닙니다.).

DLL에있는 기능을 가져 오는 다른 아이디어가 있습니까? (물론 파이썬에서)

Windows에서 Python 2.6을 사용하고 있습니다.

도움이 되었습니까?

해결책

내가 아는 한, 이것을하는 쉬운 방법은 없습니다. 외부 도구를 사용해야합니다 (예 : link /dump /exports) 또는 PE/DLL 파서를 사용하십시오 (예 : Pefile).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top