libparticlePython

Questions on the backend software of a Particle Computer system provided by TecO (e.g. LibParticle, ParticleAnalyzer, ...)

Moderator: Particle-Moderators

libparticlePython

Postby dhong » Wed Apr 30, 2008 4:51 am

Dear all,

It might help someone who want to use particle sensor with python.

*Software environment: Python2.5, Windows XP, Visual Studio 2005

*libparticle: downloaded from https://teco62pc.teco.edu/projects/libp ... rticle.zip

You can find several sources and libraries. And you can also find _particle.dll in build-win32\libparticlePython
To import particle.py from python script environment, you have to change _particle.dll to _particle.pyd (I don't know why, but that's the way it works).

Then, check with analyzer.py from somewhere else you can find it.
or just type the following code:

import particle

socket = particle.ParticleSocket(5555)
while(True):
pck = socket.receive(socket)
if pck != None:
pck.describe()

Hopefully, it will help you to use libparticle with python.
dhong
 
Posts: 2
Joined: Tue Apr 29, 2008 1:00 am

Return to TecO's Backend Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron