Re: newbie questions

new topic     » goto parent     » topic index » view thread      » older message » newer message

Phil,

Just simply change

 ok = c_func (OpenZipFile, ZipFile)

to

ok = c_func (OpenZipFile, {ZipFile})


In the first case, ZipFile is a sequence (in this case a string) which
happens to be composed of thirteen atoms (in this case characters).  The
c_func() function expects a sequence having the parameters to be passed as
the elements.  The way you had it originally, the string is broken into its
13 individual characters, which c_func() attempts to pass as 13 parameters.
Enclosing Zipfile in curly braces makes a sequence with one element
(ZipFile), which c_func() with then pass as the single parameter.

This error is very common--I've done it a hundred times myself.

-- Mike Nelson

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu