hi, i've just been tinkering with pyrex, trying to do this (below).<br>but it segfaults on the sscanf line in pyscanf. <br>what am i doing wrong? is this more involved than my naive approach? <br><br>thanks,<br>-brent<br>
<br>##############################<br># pyscanf.pyx<br><br>cdef extern from "stdio.h":<br> int sscanf (char *,char *,...)<br><br>def pyscanf(char * str):<br> cdef char * q<br> cdef char * s<br> cdef int my_int
<br> cdef float my_float
<br> sscanf(str,"%s %s %i %f",q,s,&my_int,&my_float)<br> return [q,s,my_int,my_float]<br><br><br>####### run with ###########<br>from pyscanf import pyscanf<br>print pyscanf("asdf asdf 123
12.22")