WindowsXP/ CTypes - How to convert ctypes array to a string?

D

dudeja.rajat

Hi,

I've used CTYPES module to access a function from a dll. This function
provides me the version of the dll. This information is accessible to
me as an array of 4 long inetegers. information as :
2, 1, 5, 0


I want to display these elements concatenated as "v2.1.5.0". This
string ( I'm thinking of writing the above 4 array elements to a
string) is to be displayed as label in a GUI ( the GUI used is Tk)

Please suggest how can I write these elements to a string to get me
the desired results as "v2.1.5.0". And, is writing to a string is
right way?

PS: this string also needs to be displayed in the GUI label well.


FYI, the code written to access function from dll is as under:
********
from ctypes import *
abc = windll.af1xEvdoRDll
GetVersion = abc.af1xEvdoRDll_GetVersion
print GetVersion
versionArr = c_long * 4
version = versionArr(0, 0, 0, 0)
GetVersion(version)
print version
for i in version: print i

*************
Results are : 2, 1, 5, 0

Cheers,
Rajat
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top