简体   繁体   English

适用于Mac / Windows的跨平台USB开发-可以使用Ruby / Python吗?

[英]Cross-platform USB development for Mac/Windows - possible with Ruby/Python?

I'd like to develop an app that runs natively (self-contained executable) for both Mac and Windows that will detect/poll for a USB device being inserted and send an HTTP call as a result. 我想为Mac和Windows开发一个本机运行的应用程序(自包含可执行文件),该应用程序将检测/轮询正在插入的USB设备并发送HTTP调用。 I'm mainly a Ruby programmer, so ideally I could do this with a combination of Macruby/IronRuby and shared libraries, but it's looking like libusb requires a special driver to be installed on Windows (which I can't expect the clients to do). 我主要是Ruby程序员,因此理想情况下,我可以结合使用Macruby / IronRuby和共享库来执行此操作,但是看起来libusb需要在Windows上安装特殊的驱动程序(我不能期望客户端会这样做) )。

Are there libraries/gems that would facilitate this? 是否有图书馆/宝石可以帮助实现这一目标? Is it possible to do what I'm describing using Python/Ruby? 是否可以使用Python / Ruby执行我正在描述的操作? It's not as important to be shared code as it is that the codebase is Python/Ruby/single language. 共享代码并不重要,因为代码库是Python / Ruby /单语言。 libusb would be ideal if it didn't require an install of a special driver on Windows. 如果libusb不需要在Windows上安装特殊驱动程序,则将是理想的选择。

Well it is definitely possible; 好吧,这绝对有可能; I don't know what the equivalent is in rubygems by pyUSB is a easy to use module you can leverage to do this and then there are numerous http libraries for python. 我不知道pyUSB的rubygems中的等效项是一个易于使用的模块,您可以利用它执行此操作,然后有许多用于python的http库。

As for making it self contained, it is possible but not ideal. 至于使其自成一体,这是可能的,但并不理想。 py2exe is a program that basically takes a copy of the python interpreter, all dependencies used in your programs and your script and glues it all together in a exe file, but by default py2exe will not pack it into a exe, but there are instructions on the wiki py2exe是一个程序,该程序基本上获取python解释器的副本,程序和脚本中使用的所有依赖项,并将其全部粘贴到exe文件中,但是默认情况下py2exe不会将其打包到exe中,但是有说明维基

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM