Re: How to pass FILE *

Discussion in 'Python' started by Chris Rebert, Sep 29, 2012.

  1. Chris Rebert

    Chris Rebert Guest

    On Fri, Sep 28, 2012 at 2:55 PM, xDog Walker <> wrote:
    >
    > The function I am trying to call wants a FILE *:
    >
    > dlg_progressbox(const char *title,
    > const char *cprompt,
    > int height,
    > int width,
    > int pauseopt,
    > FILE *fp)
    >
    > I can open the file to be referenced:
    >
    > fp = os.fdopen(self.pipefds[0], 'r')
    >
    > Every thing I've tried ends with ctypes raising a TypeError.


    What specifically did you try?

    A tiny bit of googling suggests the following approach:
    http://stackoverflow.com/questions/3794309/python-ctypes-python-file-object-c-file/3794401#3794401
    Related POSIX docs:
    http://pubs.opengroup.org/onlinepubs/009695399/functions/fdopen.html

    Cheers,
    Chris
    Chris Rebert, Sep 29, 2012
    #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. Jerry
    Replies:
    20
    Views:
    7,892
    Roedy Green
    Sep 9, 2005
  2. blufox
    Replies:
    2
    Views:
    537
  3. Mr A
    Replies:
    111
    Views:
    2,057
  4. Radde
    Replies:
    38
    Views:
    981
  5. Robert
    Replies:
    10
    Views:
    1,356
    E. Robert Tisdale
    Aug 24, 2005
Loading...

Share This Page