TypeError: 'module object is not callable'

cjt22 at bath.ac.uk cjt22 at bath.ac.uk
Tue Sep 4 06:52:03 EDT 2007


On Sep 4, 11:24 am, "Amit Khemka" <khemkaa... at gmail.com> wrote:
> On 9/4/07, Chris.T... at jet.uk <Chris.T... at jet.uk> wrote:
>
> > Thanks guys. Changing to how Python does things has a lot of geting
> > used to!
> > Do any of you have any ideas on the best way to do the following
> > problem:
>
> > Each loop I perform, I get a new list of Strings.
> > I then want to print these lists as columns adjacent to each other
> > starting with the first
> > created list in the first column and last created list in the final
> > column.
>
> > If you need any more information, just let me know!
> > Cheers
>
> If I understand correctly what you may want is:
>
> >>> l =  ['1', '2', '3', '4']
>
> you can do:
>
> >>> print "\t".join(l)  # lookup join method in stringmodule,
>
> assuming "\t" as the delimiter
>
> or,
>
> >>> for i in l:
>
> ....     print i, '\t' ,   # note the trailing ","
>
> If this isnotwhat you want, post an example.
>
> Btw, Please post new issues in a separate thread.
>
> Cheers,
> --
> ----
> Amit Khemka
> website:www.onyomo.com
> wap-site:www.owap.in

I think that is very similar to what I want to do.
Say I had lists a = ["1" , "2", "3"]  b = ["4", "5", "6"]  c = ["7",
"8", "9"]
Stored in another list d = [a,b,c]
I want the printed output from d to be of the form:
1   4   7
2   5   8
3   6   9

>From what I am aware, there is no table module to do this. The '\t'
operator looks like it can allow this,
I am playing with it at the moment, although going for my lunch break
now!




More information about the Python-list mailing list