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

Discussion in 'Python' started by dudeja.rajat@gmail.com, Aug 19, 2008.

  1. Guest

    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
     
    , Aug 19, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SpamProof
    Replies:
    0
    Views:
    605
    SpamProof
    Oct 21, 2003
  2. Andrius B.

    ASP on WindowsXP

    Andrius B., Feb 7, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    415
    Andrius B.
    Feb 8, 2006
  3. Replies:
    1
    Views:
    454
    Roedy Green
    Nov 2, 2005
  4. Replies:
    1
    Views:
    327
    Diez B. Roggisch
    Aug 19, 2008
  5. Wanderer
    Replies:
    1
    Views:
    602
    Wanderer
    Mar 24, 2011
Loading...

Share This Page