
22 Jun
2008
22 Jun
'08
9 a.m.
Wagner, Frank schrieb:
Hallo,
ich beschäftige mich seit kurzer Zeit etwas mit Python und lese nun Daten seriell von einem Gerät aus. Leider ist diese Schnittstelle nicht Zeichenorientier sondern es komme direkt die Messwerte im float Format über die Schnittstelle. Ich erhalte somit eine Zeichenkette die wie folgt aussieht: ['\xaa\xaa\x00\x10$\xbf\x00\x9c`A\xfd\xd0']
In C würde ich irgend sowas wie atoi versuchen anzuwenden aber in Python hab ich bisher nichts gefunden und hoffe nun dass mir jemand aus der Liste weiterhelfen kann?
Für so etwas benutzt man in Python das ``struct``-Modul.
Georg
--
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.