在Ubuntu中导入python中的dll [英] Importing a dll in python on Ubuntu

查看:797
本文介绍了在Ubuntu中导入python中的dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要将API用于我们的应用程序,在这种情况下,我需要使用由API提供者给我的DLL。他们关于api集成的代码示例是在Visual Basic中编写的...我在谷歌搜索了一些例子,使用 ctypes ,我尝试使用 cdll pydll ,导致以下错误...


OSError:/home//some.dll:无效的ELF标头


一种可能性是使用IronPython,但是没有太多关于ironpython的信息,所以我不知道它是否会完全满足我的需要..



有没有任何可用的模块,让我使用该dll在python(或者是我从exixting那里丢失的异物)。很难升级我的python版本?

解决方案

DLL是Windows生物。您可以使用DLL的唯一方法是使用Windows构建的Python。将Windows安装在虚拟机中,即可在Ubuntu上运行Windows Python。您也可以使用 Wine 进行运行。



当然,另一种方法是询问您的API提供程序是否具有Linux版本的API。


I am using python 2.6.5 on an Ubuntu intalled server.

I need to integrate an API for our applicaion, in that case, i needed to use a DLL given to me by the API provider. Their example of code about api integration is written in Visual Basic... I made a search on google and found some examples of using ctypes , and i try using cdll and pydll, which caused the following error...

OSError: /home//some.dll: invalid ELF header

One possibility is using IronPython, but i do not have much information about ironpython so i am not sure if it will handle my needs completely..

Is there any available module that let me use that dll on python (or aynthing that i am missing from the exixting ones). It is hard to upgrade my python version?

解决方案

DLLs are Windows creatures. The only way you'll be able to use a DLL is by using a Windows build of Python. You'll be able to run Windows Python on Ubuntu by having Windows installed inside a virtual machine. You also might be able to run it using Wine.

An alternative, of course, is to ask your API provider if they have a Linux version of the API.

这篇关于在Ubuntu中导入python中的dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆