使用 Visual Studio 在 IronPython 中引用库

Reference a library in IronPython using Visual Studio

我是 Python 的新手,我正在尝试使用 IronPython.[=15 在 Visual Studio CE 2015 上编写我的第一个 Python 应用程序=]

我终于设法执行了导入 clr 模块(随整个 IronPython 包一起提供)的最基本的 .NET 兼容代码,但是,由于我的目标是编写一个应用程序在 this blog post 之后从 USB 秤读取,我一直在尝试导入 usb 模块。

我下载并安装了 pyUSB 和 libusb,所以我想我必须像任何其他普通 .NET 应用程序一样简单地在 "reference" 部分添加引用,但我既找不到引用也找不到DLL 文件路径。少了什么link??

import clr
clr.AddReferenceToFileAndPath(r"What\Is\The\Path\Going\Here?")
import usb.core

感谢@Xaerxess,我终于明白了 python 库只是可以在编译器目录中找到的 .py 文件。我把usb目录复制到编译器的lib目录下就可以了