Skip to content

carlonicolo/python-c-dll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using C DLL in Python

In this simple toy project i have created a C dll in DEV++ that compute the power of elements contained into an array.

This approach could be very uself to speed up some tasks in python taking advance of C language.

import ctypes

dll = ctypes.CDLL("./power.dll")

length = 5

FiveIntegers = ctypes.c_int * length
numArray = FiveIntegers(1,2,3,4,5)

for i in numArray: print(i, end=" ")
print()
resArray = FiveIntegers()

dll.powArr(numArray, resArray, length, 3)
for i in resArray: print(i, end=" ")

You can see the power.dll inside the folder /powerDLL and check how it works.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published