6

When I tried to import ctypes.wintypes am getting this error, how can I fix this?

In [2]: import ctypes.wintypes --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-2-8395760a4e8a> in <module>() ----> 1 import ctypes.wintypes /usr/lib/python2.7/ctypes/wintypes.py in <module>() 21 22 from ctypes import _SimpleCData ---> 23 class VARIANT_BOOL(_SimpleCData): 24 _type_ = "v" 25 def __repr__(self): ValueError: _type_ 'v' not supported 

1 Answer 1

8

You can import ctypes.wintypes only in Windows. (ctypes.wintypes contains windows specific data types.)

Windows:

>>> import ctypes.wintypes >>> 

Linux:

>>> import ctypes.wintypes Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/ctypes/wintypes.py", line 23, in <module> class VARIANT_BOOL(_SimpleCData): ValueError: _type_ 'v' not supported >>> 
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks :) In my c program there is a thread which continously reads the com port how can i access that in python in windows
@ganeshredcobra, Post a separated question.
@LucasCimon Please post a separated question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.