Reference a library in IronPython using Visual Studio
Asked Answered
U

1

1

I'm new at Python, and I'm trying to write my first Python application on Visual Studio CE 2015 using IronPython.

I finally managed to execute the most basic .NET-compatible code importing the clr module (which comes with the whole IronPython package) but, since my goal is writing an application that reads from a USB scale following this blog post, I'm stuck at trying to import the usb module.

I downloaded and installed both pyUSB and libusb, so I thought I had to simply add the reference in the "reference" section like any other normal .NET applications, but I can't find nor the reference nor the DLL file path. What's the missing link??

import clr
clr.AddReferenceToFileAndPath(r"What\Is\The\Path\Going\Here?")
import usb.core
Underprivileged answered 15/6, 2017 at 8:56 Comment(0)
U
1

Thanks to @Xaerxess, I finally understand python libraries are just .py files that are to be found in the compiler directory. I copied the usb directory under the compiler's lib directory and it worked.

Underprivileged answered 15/6, 2017 at 10:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.