[Tutor] question about type str

shawn bright nephish at gmail.com
Sat Jul 29 17:13:58 CEST 2006


gee whiz, i thought i had poured over that line sufficiently.
It works now. imagine that.
thanks,
shawn

On 7/29/06, Python <python at venix.com> wrote:
>
> On Sat, 2006-07-29 at 09:26 -0500, shawn bright wrote:
> > Hey there,
> > i have an app with this line.....
> > sys.stderr.write("GET DATA %s %d %d\n" (sound, time_limit, digit_count))
>
> sys.stderr.write("GET DATA %s %d %d\n" % (sound, time_limit, digit_count))
>                                    ----^----
> You meant to do string interpolation, but left out the interpolation
> (formating) operator.  So the parenthesized expression looked like a
> function call.
>
> >
> > it is failing with the following error.
> >
> > Traceback (most recent call last):
> >   File "/usr/share/asterisk/agi-bin/ast_agi_test.agi", line 88, in ?
> >     entered_digits = getNumber(welcome, time_limit, password_digits)
> >   File "/usr/share/asterisk/agi-bin/ast_agi_test.agi", line 72, in
> > getNumber
> >     sys.stderr.write("GET DATA %s %d %d\n" (sound, time_limit,
> > digit_count))
> > TypeError: 'str' object is not callable
> >
> >
> > anyone know what i may be doing wrong here?
> >
> > thanks
> > shawn
> > _______________________________________________
> > Tutor maillist  -  Tutor at python.org
> > http://mail.python.org/mailman/listinfo/tutor
> --
> Lloyd Kvam
> Venix Corp
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060729/eac2c74d/attachment.htm 


More information about the Tutor mailing list