Difference between revisions of "WIN Python IDE"

From SecuTech Wiki
Jump to: navigation, search
(5)Write code in python IDLE)
Line 27: Line 27:
 
<br>
 
<br>
 
==5)Write code in python IDLE==
 
==5)Write code in python IDLE==
[[File:WIN Python IDE Pic 12.jpg|px750|center]]
+
[[File:WIN Python IDE Pic 12.jpg|750px|center]]
 
<br>
 
<br>
[[File:WIN Python IDE Pic 13.jpg|px750|center]]
+
[[File:WIN Python IDE Pic 13.jpg|750px|center]]
 
<br>
 
<br>
 
Please write the following code in Python Shell.
 
Please write the following code in Python Shell.
Line 40: Line 40:
 
>>0
 
>>0
 
The return 0 indicates that a UniKey dongle is successfully found.
 
The return 0 indicates that a UniKey dongle is successfully found.
[[File:WIN Python IDE Pic 14.jpg|px750|center]]
+
[[File:WIN Python IDE Pic 14.jpg|750px|center]]
  
 
[[Category:UniKey Library Integration Guide]]
 
[[Category:UniKey Library Integration Guide]]

Revision as of 04:10, 18 April 2012

How to Load UniKey.dll in Python

1) Download Python 3.1.2( you can download the lastest version )

2) Install Python (run setup)

WIN Python IDE Pic 1.jpg


WIN Python IDE Pic 2.jpg


WIN Python IDE Pic 3.jpg


WIN Python IDE Pic 4.jpg


WIN Python IDE Pic 5.jpg


3)Set the environment path

WIN Python IDE Pic 6.jpg


WIN Python IDE Pic 7.jpg


WIN Python IDE Pic 8.jpg


WIN Python IDE Pic 9.jpg


WIN Python IDE Pic 10.jpg


4)Copy the UniKey.dll file into the working directory

px750


5)Write code in python IDLE

WIN Python IDE Pic 12.jpg


WIN Python IDE Pic 13.jpg


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 is successfully found.

WIN Python IDE Pic 14.jpg