[Tutor] set the BETWEEN range in the SQL query using the python datetime function

Norman Khine norman at khine.net
Fri Jun 24 13:53:46 CEST 2011


On Fri, Jun 24, 2011 at 1:31 PM, Christian Witts <cwitts at compuscan.co.za> wrote:
> On 2011/06/24 01:19 PM, Norman Khine wrote:
>
> thank you, it was simpler than what i was trying to do, here is the
> revised version:
>
> http://pastie.org/2115586
>
> one thing i am getting an error is on like 103, in that if, i change
> (http://pastie.org/2115615):
>
> -plt.legend(('Income - GBP', 'Discounts', 'Google AdWords - GBP',
> 'Commission - %s GBP' % (total_commission)),
> +plt.legend(('Income - GBP', 'Discounts', 'Google AdWords - %s GBP',
> 'Commission - %s GBP' % (total_adwords, total_commission)),
>             'upper right', shadow=True)
>
> i get the following traceback:
>
> Traceback (most recent call last):
>   File "commission.py", line 119, in <module>
>     plt.legend(('Income - GBP', 'Discounts', 'Google AdWords - %s
> GBP', 'Commission - %s GBP' % (total_adwords, total_commission)),
> TypeError: not all arguments converted during string formatting
>
> what am i missing?
>
> thanks
>
> norman
>
> You've got 'Google AdWords - %s GBP' with no arguments and 'Commission - %s
> GBP' with 2 arguments.

thanks

>
> --
>
> Christian Witts
> Python Developer
>
>



-- 
˙ʇı ɹoɟ ƃuıʎɐd ǝɹ,noʎ ʍou puɐ ǝɔıoɥɔ ɐ ʞooʇ ı ʇɐɥʇ sı 'ʇlnɔıɟɟıp sı ʇɐɥʍ
˙uʍop ǝpısdn p,uɹnʇ pןɹoʍ ǝɥʇ ǝǝs noʎ 'ʇuǝɯɐן sǝɯıʇ ǝɥʇ puɐ 'ʇuǝʇuoɔ
ǝq s,ʇǝן ʇǝʎ
%>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or
chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )


More information about the Tutor mailing list