Hallo,
ich hab hier ein Problem mit pyserial:
Das ganze ist noch unter Windows, weil das Kabel noch nicht in den Keller liegt..
Jetzt mag es sein, dass sich die Syntax geändert hat, zwischen python 2.7 und 3.2...
Ich kann aber keine Doku zu pyserial unter python 3.2 finden. Hat jemand von euch da Erfahrung?
Gruß,
Hendrik
ich hab hier ein Problem mit pyserial:
Code:
>>> ser=serial.Serial()
>>> ser.port=comport
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'comport' is not defined
>>> exit()
c:\Python32>python
Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>> ser = serial.Serial(15)
>>> ser.write("?")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\Python32\lib\site-packages\serial\serialwin32.py", line 283, in write
data = to_bytes(data)
File "c:\Python32\lib\site-packages\serial\serialutil.py", line 76, in to_byte
s
b.append(item) # this one handles int and str for our emulation and ints fo
r Python 3.x
TypeError: an integer is required
>>>
Jetzt mag es sein, dass sich die Syntax geändert hat, zwischen python 2.7 und 3.2...
Ich kann aber keine Doku zu pyserial unter python 3.2 finden. Hat jemand von euch da Erfahrung?
Gruß,
Hendrik


Kommentar