WIN Python IDE

From SecuTech Wiki
Jump to: navigation, search


How to Load UniKey.dll in Python

Download Python 3.1.2 (you can download the latest version)

Install Python (run setup)

Python setup window


Python installation directory


Python what features to install


Python installing Python


Python install complete

Set the Environment Path

My Computer - Properties


system properties


environment variables


new user variable


running python on the command-line

Copy the UniKey.dll File into the Working Directory

Python working directory

Write Code in Python IDLE

opening Python IDLE


Python shell


Please write the following code in Python Shell.

>>> import ctypes as C
>>> h=C.c_short()
>>> lp1 = C.c_ulong()
>>> lp2 = C.c_ulong()
>>> dll = C.windll.LoadLibrary('UniKey.dll')
>>> dll.UniKey_Find(C.byref (h) , C.byref (lp1) , C.byref(lp2))
0

The return 0 indicates that a UniKey dongle has been successfully found.

Python shell running code