import os
import sys
from ctypes import *

test = cdll.LoadLibrary('D:\Python27\py.dll')
print test.Add(1, 2)
test.Echo("hello dll")

mypath = sys.argv[1]
if not os.path.exists(mypath):
    print "The path %s does not exist!" % mypath
    sys.exit(2)

for f in [s for s in os.listdir(mypath) if os.path.splitext(s)[1] == ".csta"]:
    outputname = f + ".csv"
    test.Analyzer(os.path.join(mypath,f), os.path.join(mypath,outputname))
    print "%s >> %s" %(f, outputname)

程序思路:

  1. 调用cdll.LoadLibrary将dll导入进来;

  2. 32bit的dll在64bit的Python中无法使用;

相关文章:

  • 2021-04-21
  • 2022-12-23
  • 2021-12-26
  • 2021-12-27
  • 2021-11-08
猜你喜欢
  • 2021-06-14
  • 2021-10-26
  • 2021-09-28
  • 2021-04-10
  • 2021-08-21
  • 2021-11-13
  • 2021-10-02
相关资源
相似解决方案