Answers for "import dll in python"

0

python using dll

You can call C functions from Python, with ctypes.

ctypes is a foreign function library for Python. It provides C compatible data types, and allowscalling functions in DLLs or shared libraries. It can be used to wrap these libraries in pure Python.

This how to do it in Python 3:

#!/usr/bin/python3
from ctypes import *

libc = cdll.LoadLibrary("/lib/x86_64-linux-gnu/libc.so.6")
printf = libc.printf
printf(b"hello worldn")
Posted by: Guest on December-14-2021
0

importing dll in python

# in C# it is
using System;
using System.IO;
using System.Windows;
using Microsoft.Win32;

# in python it is
import System;
import System.IO;
import System.Windows;
import Microsoft.Win32;
Posted by: Guest on September-22-2021

Python Answers by Framework

Browse Popular Code Answers by Language