Re: [PyGiNaC-users] Python lists of GiNaC objects?
Status: Alpha
Brought to you by:
jbrandmeyer
From: Ondrej C. <on...@ce...> - 2005-09-14 22:41:15
|
> >>> l=contfrac(3.1415926,2) > >>> print l > [<cginac.numeric object at 0xb7dbf974>, <cginac.numeric object at 0xb7dbf9bc>] > >>> print l[0] > 3 > >>> print l[1] > 7 > >>> print l[0:1] > [<cginac.numeric object at 0xb7dbf974>] > > I wish to print [3,7]. What am I missing? You need to do something like this (see unittests for more info): print [str(x) for x in l] this should print [3,7] Ondrej Certik |