Go Down

Topic: PySerial (Read 535 times) previous topic - next topic

InsingerTech

Hi All.
I have been trying to use pyserial.
I have python 2.6.1 and pyserial 2.4
I have reninstalled pyserial and tried diffrent versions but nothing works.
whenever i type in "import serial" this is what happens
Traceback (most recent call last):
 File "<pyshell#0>", line 1, in <module>
   import serial
 File "C:\Python26\lib\site-packages\serial\__init__.py", line 18, in <module>
   from serialwin32 import *
 File "C:\Python26\lib\site-packages\serial\serialwin32.py", line 9, in <module>
   import win32file  # The base COM port and file IO functions.
ImportError: No module named win32file

imagitronics

Looks like you just need to install the pywin32 package for python:

http://sourceforge.net/projects/pywin32/


InsingerTech


InsingerTech

Now whenever i try to run my script
Code: [Select]

import serial
ser = serial.Serial("COM6", 9600)
ser.write('5')
raw_input("Press return to close this window...")

it doesn't write to serial
when i type all that into the shell manualy it works fine.
Any Ideas?

InsingerTech

Can someone please help me?

Go Up