[Tutor] converting a Python var to a C-type

Benoit Dupire bdupire@seatech.fau.edu
Tue, 03 Apr 2001 08:53:45 -0400


Daniel Yoo wrote:

> On Mon, 2 Apr 2001, Benoit Dupire wrote:
>
> > the type the C side would accept is contained in a Python string
> > variable:
> > examples: "int", "short", "double", "float", "ulong", "uint", "ushort",
> > "ubyte", "char"..
>
>
>  <snip  interesting answer>
>
> I'm not quite sure what you mean by "fit"; do you mean "fit" by the size
> of the structure, or range?

both actually...
if i pass 257 for a char variable, i would like to detect this at init time
before it fails at run-time.


>
> There's probably a better way to do this, but I'm getting sleepy at the
> moment.  *grin*

that's not so bad ;))))

>
>
> Anyway, hope this helps!

sure!

tks