freesumo Posted March 6, 2006 at 03:28 PM Report #17041 Posted March 6, 2006 at 03:28 PM Jython Python/FTDI-USB module Python for Windows Extensions
deathseeker25 Posted March 6, 2006 at 05:12 PM Report #17069 Posted March 6, 2006 at 05:12 PM Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform. Python integrado com Java?! Wow....isto deve ser potente. Tenho realmente que voltar a bater código em Python. O PyUSB tambem é interessante, na medida em que permite programar a porta USB e chips ligados, assim como conversores USB. # ---------- # import the PyUSB module import d2xx # list devices by description, returns tuple of attached devices description strings d = d2xx.listDevices(d2xx.OPEN_BY_DESCRIPTION) print d # list devices by serial, returns tuple of attached devices serial strings d = d2xx.listDevices() # implicit d2xx.OPEN_BY_SERIAL_NUMBER print d h = d2xx.open(0) print h # read eeprom print h.eeRead() # get queue status print h.getQueueStatus() # set RX/TX timeouts h.setTimeouts(1000,1000) # write bytes (serial mode) print h.write('Hello world!\r\n") # read bytes (serial mode) print h.read(5) # ---------- Python é fantástico....aproveitem.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now