我试图从DLL中调用函数,这似乎是在Delphi中创建的.DLL支持的一些函数的示例是:
function oziDeleteWpByName(var name:pansichar):integer;stdcall
Run Code Online (Sandbox Code Playgroud)
我为访问上述函数而编写的Python代码不起作用.
from ctypes import *
libc = cdll.OziAPI
name ='test'
pi = pointer(name)
delname = libc.oziDeleteWpByName
delname(name)
Run Code Online (Sandbox Code Playgroud)
我似乎将错误的数据类型传递给函数.关于如何做到这一点的任何想法?
谢谢它的工作.现在请帮助这个功能:
function oziGetOziVersion(var Version:pansichar; var DataLength:integer):integer; stdcall; OziExplorer的版本在Version变量中返回.
现在我如何传递'var version',它也将被返回.
我有一个XML文件,我想编辑或重命名元素并保存文件.什么是最好的方法.XML文件如下
<breakfast_menu>
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>two of our famous Belgian Waffles with plenty of real maple syrup</description>
<calories>650</calories>
</food>
<food>
<name>Strawberry Belgian Waffles</name>
<price>$7.95</price>
<description>light Belgian waffles covered with strawberries and whipped cream</description>
<calories>900</calories>
</food>
<food>
<name>Berry-Berry Belgian Waffles</name>
<price>$8.95</price>
<description>light Belgian waffles covered with an assortment of fresh berries and whipped cream</description>
<calories>900</calories>
</food>
<food>
<name>French Toast</name>
<price>$4.50</price>
<description>thick slices made from our homemade sourdough bread</description>
<calories>600</calories>
</food>
<food>
<name>Homestyle Breakfast</name>
<price>$6.95</price>
<description>two eggs, bacon or sausage, toast, …Run Code Online (Sandbox Code Playgroud) 我有 50 个 XML 文件的标签不匹配,我想使用 python 修复它们。开始标签<names>与结束标签不同</name>。任何人都可以请指导我。
<breakfast_menu>
<food>
<names>Belgian Waffles</name>
<price>$5.95</price>
<calories>650</calories>
</food>
</breakfast_menu>
Run Code Online (Sandbox Code Playgroud)