On Oct 1, 1:13 pm, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote:
> On Wed, 1 Oct 2008 04:43:34 -0700 (PDT)
>
> sandric ionut <[EMAIL PROTECTED]> wrote:
>
> > Hello:
> > I have a text file that looks like:
> > 0 23
> > 1 342
> > 3 31
> > and I want to read the file and print it out like:
> > 0 1 3
>
Even better,
Thank you all
Ionut
- Original Message
From: D'Arcy J.M. Cain <[EMAIL PROTECTED]>
To: sandric ionut <[EMAIL PROTECTED]>
Cc: python-list@python.org
Sent: Wednesday, October 1, 2008 3:13:55 PM
Subject: Re: change line with columns when print
On Wed, 1
On Wed, 1 Oct 2008 04:43:34 -0700 (PDT)
sandric ionut <[EMAIL PROTECTED]> wrote:
>
>
> Hello:
> I have a text file that looks like:
> 0 23
> 1 342
> 3 31
> and I want to read the file and print it out like:
> 0 1 3
> 23 342 31
>
> How can I do this?
Probably tons of ways. Here's one with no in
Thank you Almar
It worked :), I now have to format it nicely
Ionut
- Original Message
From: Almar Klein <[EMAIL PROTECTED]>
To: python-list@python.org
Sent: Wednesday, October 1, 2008 2:57:00 PM
Subject: Re: change line with columns when print
Hi,
probably not the best so
Hi,
probably not the best solution, but this should work:
L1 = []
L2 = []
for i in file:
tmp = i.split(" ")
L1.append(tmp[0])
L2.append(tmp[1])
for i in L1:
print i,
print # new line
for i in L2:
print i,
print # new line
Almar
2008/10/1 sandric ionut <[EMAIL PROTECTED]>
Hello:
I have a text file that looks like:
0 23
1 342
3 31
and I want to read the file and print it out like:
0 1 3
23 342 31
How can I do this?
Thnak you in advance,
Ionut
--
http://mail.python.org/mailman/listinfo/python-list