Thank you;
seems to be an error in http://code.google.com/p/pyfpdf/wiki/Web2Py.


2012/1/1 Massimo Di Pierro <[email protected]>

> print TABLE(*['a','b'],_border='1')
>
> should be
>
> print TABLE(_border='1',*['a','b'])
>
> not all Python versions understand the above syntax.
>
> On Jan 1, 11:03 am, Martin Weissenboeck <[email protected]> wrote:
> > Hi,
> > I want to use pyfpdf and I have tried some examples found here:
> >
> > http://code.google.com/p/pyfpdf/wiki/Web2Py
> >
> > Example report showed an error in
> >
> > table = TABLE(*rows, _border="0", _align="center", _width="50%")
> >
> > I had to change it to:
> >
> > table = TABLE(rows, _border="0", _align="center", _width="50%")
> >
> > Same problem in example listing:
> > Error in
> >
> > table = TABLE(*[head, foot, body],  _border="1", _align="center",
> _width="100%")
> >
> > Changed to:
> >
> > table = TABLE(head, foot, body, _border="1", _align="center",
> _width="100%")
> >
> > Now I tried some lines of code:
> >
> > >>> print TABLE('a','b',_border='1')
> >
> > <table border="1"><tr><td>a</td></tr><tr><td>b</td></tr></table>
> >
> > >>> print TABLE(*['a','b'],_border='1')
> >
> > Traceback (most recent call last):
> >   File "gluon/contrib/shell.py", line 187, in run
> >   File "<string>", line 1
> >     print TABLE(*['a','b'],_border='1')
> >                                  ^
> > SyntaxError: invalid syntax
> >
> > >>> print TABLE(['a','b'],_border='1')
> >
> > <table border="1"><tr><td>a</td></tr><tr><td>b</td></tr></table>
> >
> > I am using 1.99.4 - is it a problem of compatibility?
> >
> > Regards, Martin
>

Reply via email to