python
Python - 부호있는 short data type 으로 변환하기.
자유프로그램
2014. 4. 11. 12:03
반응형
Python 에서 C/C++ 의 singed short data type 구하기.
import ctypes ctypes.c_short(0xfc19) ctypes.c_short(0xfc19).value
>>> import ctypes >>> ctypes.c_short(0xfc19) c_short(-999) >>> ctypes.c_short(0xfc19).value # 부호있는 short -999 >>> ctypes.c_ushort(0xfc19) # 부호없는 short c_ushort(64537) >>> 0xfc19 64537
*** ctypes 참고 : http://python.net/crew/theller/ctypes/tutorial.html
반응형