Re: why writing list to file puts each item from list on seperate line?
- From: limodou <limodou@xxxxxxxxx>
- Date: Sat, 31 Dec 2005 12:50:32 +0800
30 Dec 2005 20:44:29 -0800, homepricemaps@xxxxxxxxx <homepricemaps@xxxxxxxxx>:
> i want them to be on the same line when they are written to the file.
> right now they are written like this:
>
> food
> price
> store
>
> i want them to be written like this
>
> food price store
>
> how do i do that?
>
>>> print ' '.join(['food', 'price', 'store'])
os.linesep represents newline.
--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
.
- References:
- why writing list to file puts each item from list on seperate line?
- From: homepricemaps
- Re: why writing list to file puts each item from list on seperate line?
- From: limodou
- Re: why writing list to file puts each item from list on seperate line?
- From: homepricemaps
- why writing list to file puts each item from list on seperate line?
- Prev by Date: Re: questions about py2exe and wax
- Next by Date: Re: why writing list to file puts each item from list on seperate line?
- Previous by thread: Re: why writing list to file puts each item from list on seperate line?
- Next by thread: Re: why writing list to file puts each item from list on seperate line?
- Index(es):
Relevant Pages
|