Call a function in a shared library: Difference between revisions

Content added Content deleted
Line 450: Line 450:


=={{header|Python}}==
=={{header|Python}}==
Example that call User32.dll::GetDoubleClickTime() in windows.
The import statement can be done in a try/except block
<lang python>try:
<lang python>
import psyco
import ctypes
psyco.full()
user32_dll = ctypes.cdll.LoadLibrary('User32.dll')
print "# With psyco JIT compiler"
print user32_dll.GetDoubleClickTime()
except:
</lang>
print "# Without psyco JIT compiler"

# Rest of program</lang>


=={{header|Ruby}}==
=={{header|Ruby}}==